summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/artist.el81
-rw-r--r--lisp/textmodes/bib-mode.el17
-rw-r--r--lisp/textmodes/bibtex-style.el9
-rw-r--r--lisp/textmodes/bibtex.el17
-rw-r--r--lisp/textmodes/conf-mode.el6
-rw-r--r--lisp/textmodes/css-mode.el17
-rw-r--r--lisp/textmodes/dns-mode.el11
-rw-r--r--lisp/textmodes/enriched.el54
-rw-r--r--lisp/textmodes/fill.el32
-rw-r--r--lisp/textmodes/flyspell.el117
-rw-r--r--lisp/textmodes/ispell.el694
-rw-r--r--lisp/textmodes/makeinfo.el8
-rw-r--r--lisp/textmodes/nroff-mode.el26
-rw-r--r--lisp/textmodes/page-ext.el23
-rw-r--r--lisp/textmodes/page.el5
-rw-r--r--lisp/textmodes/paragraphs.el5
-rw-r--r--lisp/textmodes/picture.el22
-rw-r--r--lisp/textmodes/po.el4
-rw-r--r--lisp/textmodes/refbib.el4
-rw-r--r--lisp/textmodes/refer.el10
-rw-r--r--lisp/textmodes/refill.el4
-rw-r--r--lisp/textmodes/reftex-auc.el7
-rw-r--r--lisp/textmodes/reftex-cite.el55
-rw-r--r--lisp/textmodes/reftex-dcr.el7
-rw-r--r--lisp/textmodes/reftex-global.el5
-rw-r--r--lisp/textmodes/reftex-index.el374
-rw-r--r--lisp/textmodes/reftex-parse.el20
-rw-r--r--lisp/textmodes/reftex-ref.el60
-rw-r--r--lisp/textmodes/reftex-sel.el273
-rw-r--r--lisp/textmodes/reftex-toc.el249
-rw-r--r--lisp/textmodes/reftex-vars.el5
-rw-r--r--lisp/textmodes/reftex.el52
-rw-r--r--lisp/textmodes/remember.el13
-rw-r--r--lisp/textmodes/rst.el400
-rw-r--r--lisp/textmodes/sgml-mode.el42
-rw-r--r--lisp/textmodes/spell.el172
-rw-r--r--lisp/textmodes/table.el110
-rw-r--r--lisp/textmodes/tex-mode.el404
-rw-r--r--lisp/textmodes/texinfmt.el55
-rw-r--r--lisp/textmodes/texinfo.el187
-rw-r--r--lisp/textmodes/texnfo-upd.el63
-rw-r--r--lisp/textmodes/text-mode.el7
-rw-r--r--lisp/textmodes/tildify.el4
-rw-r--r--lisp/textmodes/two-column.el14
-rw-r--r--lisp/textmodes/underline.el4
45 files changed, 1813 insertions, 1935 deletions
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index f7ef5584410..2325d7b26ff 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -1,7 +1,6 @@
;;; artist.el --- draw ascii graphics with your mouse
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2011 Free Software Foundation, Inc.
;; Author: Tomas Abrahamsson <tab@lysator.liu.se>
;; Maintainer: Tomas Abrahamsson <tab@lysator.liu.se>
@@ -423,7 +422,7 @@ be in `artist-spray-chars', or spraying will behave strangely.")
(defvar artist-mode-name " Artist"
"Name of Artist mode beginning with a space (appears in the mode-line).")
-(defvar artist-curr-go 'pen-char
+(defvar artist-curr-go 'pen-line
"Current selected graphics operation.")
(make-variable-buffer-local 'artist-curr-go)
@@ -503,6 +502,49 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
(defvar artist-arrow-point-1 nil)
(defvar artist-arrow-point-2 nil)
+(defvar artist-menu-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [spray-chars]
+ '(menu-item "Characters for Spray" artist-select-spray-chars
+ :help "Choose characters for sprayed by the spray-can"))
+ (define-key map [borders]
+ '(menu-item "Draw Shape Borders" artist-toggle-borderless-shapes
+ :help "Toggle whether shapes are drawn with borders"
+ :button (:toggle . (not artist-borderless-shapes))))
+ (define-key map [trimming]
+ '(menu-item "Trim Line Endings" artist-toggle-trim-line-endings
+ :help "Toggle trimming of line-endings"
+ :button (:toggle . artist-trim-line-endings)))
+ (define-key map [rubber-band]
+ '(menu-item "Rubber-banding" artist-toggle-rubber-banding
+ :help "Toggle rubber-banding"
+ :button (:toggle . artist-rubber-banding)))
+ (define-key map [set-erase]
+ '(menu-item "Character to Erase..." artist-select-erase-char
+ :help "Choose a specific character to erase"))
+ (define-key map [set-line]
+ '(menu-item "Character for Line..." artist-select-line-char
+ :help "Choose the character to insert when drawing lines"))
+ (define-key map [set-fill]
+ '(menu-item "Character for Fill..." artist-select-fill-char
+ :help "Choose the character to insert when filling in shapes"))
+ (define-key map [artist-separator] '(menu-item "--"))
+ (dolist (op '(("Vaporize" artist-select-op-vaporize-lines vaporize-lines)
+ ("Erase" artist-select-op-erase-rectangle erase-rect)
+ ("Spray-can" artist-select-op-spray-set-size spray-get-size)
+ ("Text" artist-select-op-text-overwrite text-ovwrt)
+ ("Ellipse" artist-select-op-circle circle)
+ ("Poly-line" artist-select-op-straight-poly-line spolyline)
+ ("Rectangle" artist-select-op-square square)
+ ("Line" artist-select-op-straight-line s-line)
+ ("Pen" artist-select-op-pen-line pen-line)))
+ (define-key map (vector (nth 2 op))
+ `(menu-item ,(nth 0 op)
+ ,(nth 1 op)
+ :help ,(format "Draw using the %s style" (nth 0 op))
+ :button (:radio . (eq artist-curr-go ',(nth 2 op))))))
+ map))
+
(defvar artist-mode-map
(let ((map (make-sparse-keymap)))
(setq artist-mode-map (make-sparse-keymap))
@@ -555,6 +597,7 @@ This variable is initialized by the `artist-make-prev-next-op-alist' function.")
(define-key map "\C-c\C-a\C-y" 'artist-select-op-paste)
(define-key map "\C-c\C-af" 'artist-select-op-flood-fill)
(define-key map "\C-c\C-a\C-b" 'artist-submit-bug-report)
+ (define-key map [menu-bar artist] (cons "Artist" artist-menu-map))
map)
"Keymap for `artist-minor-mode'.")
@@ -1899,7 +1942,7 @@ Return a list (RETURN-CODE STDOUT STDERR)."
;;
;; Example: In the figure below, the `X' is the very last
;; character in the buffer ("a non-empty line at the
- ;; end"). Suppose point is at at P. Then (forward-line 1)
+ ;; end"). Suppose point is at P. Then (forward-line 1)
;; returns 0 and puts point after the `X'.
;;
;; --------top of buffer--------
@@ -1957,24 +2000,11 @@ The replacement is used to convert tabs and new-lines to spaces."
(defun artist-replace-char (new-char)
"Replace the character at point with NEW-CHAR."
- ;; Check that the variable exists first. The doc says it was added in 19.23.
- (if (and (and (boundp 'emacs-major-version) (= emacs-major-version 20))
- (and (boundp 'emacs-minor-version) (<= emacs-minor-version 3)))
- ;; This is a bug workaround for Emacs 20, versions up to 20.3:
- ;; The self-insert-command doesn't care about the overwrite-mode,
- ;; so the insertion is done in the same way as in picture mode.
- ;; This seems to be a little bit slower.
- (progn
- (artist-move-to-xy (1+ (artist-current-column))
- (artist-current-line))
- (delete-char -1)
- (insert (artist-get-replacement-char new-char)))
- ;; In emacs-19, the self-insert-command works better and faster
- (let ((overwrite-mode 'overwrite-mode-textual)
- (fill-column 32765) ; Large :-)
- (blink-matching-paren nil))
- (setq last-command-event (artist-get-replacement-char new-char))
- (self-insert-command 1))))
+ (let ((overwrite-mode 'overwrite-mode-textual)
+ (fill-column 32765) ; Large :-)
+ (blink-matching-paren nil))
+ (setq last-command-event (artist-get-replacement-char new-char))
+ (self-insert-command 1)))
(defun artist-replace-chars (new-char count)
"Replace characters at point with NEW-CHAR. COUNT chars are replaced."
@@ -4000,7 +4030,7 @@ The 2-point shape SHAPE is drawn from X1, Y1 to X2, Y2."
(defun artist-draw-region-trim-line-endings (min-y max-y)
"Trim lines in current draw-region from MIN-Y to MAX-Y.
Trimming here means removing white space at end of a line."
- ;; Safetyc check: switch min-y and max-y if if max-y is smaller
+ ;; Safety check: switch min-y and max-y if max-y is smaller
(if (< max-y min-y)
(let ((tmp min-y))
(setq min-y max-y)
@@ -4615,6 +4645,10 @@ If optional argument STATE is positive, turn borders on."
(artist-arrow-point-set-state artist-arrow-point-2 new-state)))))
+(defun artist-select-op-pen-line ()
+ "Select drawing pen lines."
+ (interactive)
+ (artist-select-operation "Pen Line"))
(defun artist-select-op-line ()
"Select drawing lines."
@@ -5570,5 +5604,4 @@ The event, EV, is the mouse event."
;; Don't hesitate to ask me any questions.
-;; arch-tag: 3e63b881-aaaa-4b83-a072-220d4661a8a3
;;; artist.el ends here
diff --git a/lisp/textmodes/bib-mode.el b/lisp/textmodes/bib-mode.el
index dcd6baa53b3..17ddd1de954 100644
--- a/lisp/textmodes/bib-mode.el
+++ b/lisp/textmodes/bib-mode.el
@@ -1,7 +1,6 @@
;;; bib-mode.el --- major mode for editing bib files
-;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2011 Free Software Foundation, Inc.
;; Author: Henry Kautz
;; (according to authors.el)
@@ -48,11 +47,14 @@
:type 'file
:group 'bib)
-(defvar bib-mode-map (copy-keymap text-mode-map))
-(define-key bib-mode-map "\C-M" 'return-key-bib)
-(define-key bib-mode-map "\C-c\C-u" 'unread-bib)
-(define-key bib-mode-map "\C-c\C-@" 'mark-bib)
-(define-key bib-mode-map "\e`" 'abbrev-mode)
+(defvar bib-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map text-mode-map)
+ (define-key map "\C-M" 'return-key-bib)
+ (define-key map "\C-c\C-u" 'unread-bib)
+ (define-key map "\C-c\C-@" 'mark-bib)
+ (define-key map "\e`" 'abbrev-mode)
+ map))
(defun addbib ()
"Set up editor to add to troff bibliography file specified
@@ -236,5 +238,4 @@ named by variable `unread-bib-file'."
(provide 'bib-mode)
-;; arch-tag: e3a97958-3c2c-487f-9557-fafc3c98452d
;;; bib-mode.el ends here
diff --git a/lisp/textmodes/bibtex-style.el b/lisp/textmodes/bibtex-style.el
index e5ded8b15ca..bc5326240a3 100644
--- a/lisp/textmodes/bibtex-style.el
+++ b/lisp/textmodes/bibtex-style.el
@@ -1,6 +1,6 @@
-;;; bibtex-style.el --- Major mode for BibTeX Style files
+;;; bibtex-style.el --- Major mode for BibTeX Style files -*- lexical-binding: t -*-
-;; Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: tex
@@ -63,8 +63,6 @@
("\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}"
(2 font-lock-function-name-face))))
-;;;###autoload (add-to-list 'auto-mode-alist (cons (purecopy "\\.bst\\'") 'bibtex-style-mode))
-
;;;###autoload
(define-derived-mode bibtex-style-mode nil "BibStyle"
"Major mode for editing BibTeX style files."
@@ -143,7 +141,7 @@
(looking-at "if\\$"))
(scan-error nil))))
(save-excursion
- (condition-case err
+ (condition-case nil
(while (progn
(backward-sexp 1)
(save-excursion (skip-chars-backward " \t{") (not (bolp)))))
@@ -153,5 +151,4 @@
(provide 'bibtex-style)
-;; arch-tag: b20ad41a-fd36-466e-8fd2-cc6137f9c55c
;;; bibtex-style.el ends here
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 191ceedf041..e49d7549776 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1,8 +1,6 @@
;;; bibtex.el --- BibTeX mode for GNU Emacs
-;; Copyright (C) 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
-;; 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994-1999, 2001-2011 Free Software Foundation, Inc.
;; Author: Stefan Schoef <schoef@offis.uni-oldenburg.de>
;; Bengt Martensson <bengt@mathematik.uni-Bremen.de>
@@ -2095,7 +2093,7 @@ Formats current entry according to variable `bibtex-entry-format'."
;; if match not at left subfield boundary...
(if (< (1+ (nth 1 bounds)) (match-beginning 0))
(insert (bibtex-field-right-delimiter) " # ")
- (delete-backward-char 1))))))))
+ (delete-char -1))))))))
;; use book title of crossref'd entry
(if (and (memq 'inherit-booktitle format)
@@ -3028,12 +3026,14 @@ if that value is non-nil.
;; brace-delimited ones
)
nil
- (font-lock-syntactic-keywords . bibtex-font-lock-syntactic-keywords)
(font-lock-extra-managed-props . (category))
(font-lock-mark-block-function
. (lambda ()
(set-mark (bibtex-end-of-entry))
(bibtex-beginning-of-entry)))))
+ (set (make-local-variable 'syntax-propertize-function)
+ (syntax-propertize-via-font-lock
+ bibtex-font-lock-syntactic-keywords))
(setq imenu-generic-expression
(list (list nil bibtex-entry-head bibtex-key-in-head))
imenu-case-fold-search t)
@@ -4313,8 +4313,7 @@ If optional arg MOVE is non-nil move point to end of field."
(goto-char (bibtex-start-of-field bounds))
(forward-char) ; leading comma
(bibtex-delete-whitespace)
- (open-line 1)
- (forward-char)
+ (insert "\n")
(indent-to-column (+ bibtex-entry-offset
bibtex-field-indentation))
(re-search-forward "[ \t\n]*=" end-field)
@@ -4352,7 +4351,6 @@ column `bibtex-text-indentation' and continuation lines start here, too.
If `bibtex-align-at-equal-sign' is non-nil, align equal signs, too."
(interactive "*")
(let ((pnt (copy-marker (point)))
- (end (copy-marker (bibtex-end-of-entry)))
(beg (bibtex-beginning-of-entry)) ; move point
bounds)
(bibtex-delete-whitespace)
@@ -4364,8 +4362,7 @@ If `bibtex-align-at-equal-sign' is non-nil, align equal signs, too."
(forward-char))
(skip-chars-backward " \t\n")
(bibtex-delete-whitespace)
- (open-line 1)
- (forward-char)
+ (insert "\n")
(indent-to-column bibtex-entry-offset)
(goto-char pnt)))
diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el
index 38df3b58a5f..4e6c8bd6b05 100644
--- a/lisp/textmodes/conf-mode.el
+++ b/lisp/textmodes/conf-mode.el
@@ -1,7 +1,6 @@
;;; conf-mode.el --- Simple major mode for editing conf/ini/properties files
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
;; Author: Daniel Pfeiffer <occitan@esperanto.org>
;; Keywords: conf ini windows java
@@ -178,7 +177,7 @@ not align (only setting space according to `conf-assignment-space')."
(defvar conf-font-lock-keywords
- `(;; [section] (do this first because it may look like a parameter)
+ '(;; [section] (do this first because it may look like a parameter)
("^[ \t]*\\[\\(.+\\)\\]" 1 'font-lock-type-face)
;; var=val or var[index]=val
("^[ \t]*\\(.+?\\)\\(?:\\[\\(.*?\\)\\]\\)?[ \t]*="
@@ -621,5 +620,4 @@ For details see `conf-mode'. Example:
(provide 'conf-mode)
-;; arch-tag: 0a3805b2-0371-4d3a-8498-8897116b2356
;;; conf-mode.el ends here
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index a0e9a06bd10..ef51fb25035 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -1,6 +1,6 @@
-;;; css-mode.el --- Major mode to edit CSS files
+;;; css-mode.el --- Major mode to edit CSS files -*- lexical-binding: t -*-
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
;; Keywords: hypermedia
@@ -212,6 +212,8 @@
(defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
(defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
(defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*"))
+(defconst css-proprietary-nmstart-re ;; Vendor-specific properties.
+ "[-_]\\(?:ms\\|moz\\|o\\|webkit\\|khtml\\)-")
(defconst css-name-re (concat css-nmchar-re "+"))
(defface css-selector '((t :inherit font-lock-function-name-face))
@@ -220,6 +222,8 @@
(defface css-property '((t :inherit font-lock-variable-name-face))
"Face to use for properties."
:group 'css)
+(defface css-proprietary-property '((t :inherit (css-property italic)))
+ "Face to use for vendor-specific properties.")
(defvar css-font-lock-keywords
`(("!\\s-*important" . font-lock-builtin-face)
@@ -251,13 +255,15 @@
;; No face.
nil)))
;; Properties. Again, we don't limit ourselves to css-property-ids.
- (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" css-ident-re "\\)\\s-*:")
- (1 'css-property))))
+ (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\("
+ "\\(?:\\(" css-proprietary-nmstart-re "\\)\\|"
+ css-nmstart-re "\\)" css-nmchar-re "*"
+ "\\)\\s-*:")
+ (1 (if (match-end 2) 'css-proprietary-property 'css-property)))))
(defvar css-font-lock-defaults
'(css-font-lock-keywords nil t))
-;;;###autoload (add-to-list 'auto-mode-alist (cons (purecopy "\\.css\\'") 'css-mode))
;;;###autoload
(define-derived-mode css-mode fundamental-mode "CSS"
"Major mode to edit Cascading Style Sheets."
@@ -477,5 +483,4 @@
(indent-line-to indent)))))
(provide 'css-mode)
-;; arch-tag: b4d8b8e2-b130-4e74-b3aa-cd8f1ab659d0
;;; css-mode.el ends here
diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el
index dbd91817670..0d5d28f8e5d 100644
--- a/lisp/textmodes/dns-mode.el
+++ b/lisp/textmodes/dns-mode.el
@@ -1,7 +1,6 @@
;;; dns-mode.el --- a mode for viewing/editing Domain Name System master files
-;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2000-2001, 2004-2011 Free Software Foundation, Inc.
;; Author: Simon Josefsson <simon@josefsson.org>
;; Keywords: DNS master zone file SOA comm
@@ -28,11 +27,6 @@
;; C-c C-s Increment SOA serial.
;; Understands YYYYMMDDNN, Unix time, and serial number formats,
;; and complains if it fail to find SOA serial.
-;;
-;; Put something similar to the following in your ~/.emacs to use this file:
-;;
-;; (load "~/path/to/dns-mode.el")
-;; (setq auto-mode-alist (cons '("\\.soa\\'" . dns-mode) auto-mode-alist))
;;; References:
@@ -222,9 +216,6 @@ This function is run from `before-save-hook'."
;; We return nil in case this is used in write-contents-functions.
nil)))
-;;;###autoload(add-to-list 'auto-mode-alist (purecopy '("\\.soa\\'" . dns-mode)))
-
(provide 'dns-mode)
-;; arch-tag: 6a179f0a-072f-49db-8b01-37b8f23998c0
;;; dns-mode.el ends here
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index 19dd446420c..357b9d6c94e 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -1,7 +1,6 @@
;;; enriched.el --- read and save files in text/enriched format
-;; Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2001-2011 Free Software Foundation, Inc.
;; Author: Boris Goldowsky <boris@gnu.org>
;; Keywords: wp, faces
@@ -50,7 +49,7 @@
:group 'wp)
(defcustom enriched-verbose t
- "*If non-nil, give status messages when reading and writing files."
+ "If non-nil, give status messages when reading and writing files."
:type 'boolean
:group 'enriched)
@@ -165,6 +164,24 @@ The value is a list of \(VAR VALUE VAR VALUE...).")
(defvar enriched-rerun-flag nil)
;;;
+;;; Keybindings
+;;;
+
+(defvar enriched-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [remap move-beginning-of-line] 'beginning-of-line-text)
+ (define-key map "\C-m" 'reindent-then-newline-and-indent)
+ (define-key map
+ [remap newline-and-indent] 'reindent-then-newline-and-indent)
+ (define-key map "\M-j" 'facemenu-justification-menu)
+ (define-key map "\M-S" 'set-justification-center)
+ (define-key map "\C-x\t" 'increase-left-margin)
+ (define-key map "\C-c[" 'set-left-margin)
+ (define-key map "\C-c]" 'set-right-margin)
+ map)
+ "Keymap for Enriched mode.")
+
+;;;
;;; Define the mode
;;;
@@ -185,6 +202,8 @@ Commands:
:group 'enriched :lighter " Enriched"
(cond ((null enriched-mode)
;; Turn mode off
+ (remove-hook 'change-major-mode-hook
+ 'enriched-before-change-major-mode 'local)
(setq buffer-file-format (delq 'text/enriched buffer-file-format))
;; restore old variable values
(while enriched-old-bindings
@@ -200,6 +219,8 @@ Commands:
nil)
(t ; Turn mode on
+ (add-hook 'change-major-mode-hook
+ 'enriched-before-change-major-mode nil 'local)
(add-to-list 'buffer-file-format 'text/enriched)
;; Save old variable values before we change them.
;; These will be restored if we exit Enriched mode.
@@ -227,8 +248,6 @@ Commands:
(while enriched-old-bindings
(set (pop enriched-old-bindings) (pop enriched-old-bindings)))))
-(add-hook 'change-major-mode-hook 'enriched-before-change-major-mode)
-
(defun enriched-after-change-major-mode ()
(when enriched-mode
(let ((enriched-rerun-flag t))
@@ -236,30 +255,8 @@ Commands:
(add-hook 'after-change-major-mode-hook 'enriched-after-change-major-mode)
-;;;
-;;; Keybindings
-;;;
-
-(defvar enriched-mode-map nil
- "Keymap for Enriched mode.")
-
-(if (null enriched-mode-map)
- (fset 'enriched-mode-map (setq enriched-mode-map (make-sparse-keymap))))
-
-(if (not (assq 'enriched-mode minor-mode-map-alist))
- (setq minor-mode-map-alist
- (cons (cons 'enriched-mode enriched-mode-map)
- minor-mode-map-alist)))
-(define-key enriched-mode-map [remap move-beginning-of-line] 'beginning-of-line-text)
-(define-key enriched-mode-map "\C-m" 'reindent-then-newline-and-indent)
-(define-key enriched-mode-map
- [remap newline-and-indent] 'reindent-then-newline-and-indent)
-(define-key enriched-mode-map "\M-j" 'facemenu-justification-menu)
-(define-key enriched-mode-map "\M-S" 'set-justification-center)
-(define-key enriched-mode-map "\C-x\t" 'increase-left-margin)
-(define-key enriched-mode-map "\C-c[" 'set-left-margin)
-(define-key enriched-mode-map "\C-c]" 'set-right-margin)
+(fset 'enriched-mode-map enriched-mode-map)
;;;
;;; Some functions dealing with text-properties, especially indentation
@@ -502,5 +499,4 @@ the range of text to assign text property SYMBOL with value VALUE."
(message "Warning: invalid <x-display> parameter %s" param))
(list start end 'display prop)))
-;; arch-tag: 05cae488-3fea-45cd-ac29-5b02cb64e42b
;;; enriched.el ends here
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 044806ef5b0..2b7e9a19baa 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -1,10 +1,11 @@
;;; fill.el --- fill commands for Emacs -*- coding: utf-8 -*-
-;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1996, 1997, 1999, 2001, 2002,
-;; 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992, 1994-1997, 1999, 2001-2011
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: wp
+;; Package: emacs
;; This file is part of GNU Emacs.
@@ -136,7 +137,7 @@ The fill column to use for a line is the first column at which the column
number equals or exceeds the local fill-column - right-margin difference."
(save-excursion
(if fill-column
- (let* ((here (progn (beginning-of-line) (point)))
+ (let* ((here (line-beginning-position))
(here-col 0)
(eol (progn (end-of-line) (point)))
margin fill-col change col)
@@ -657,7 +658,7 @@ space does not end a sentence, so don't break a line there."
(if (and oneleft
(not (and use-hard-newlines
(get-text-property (1- (point)) 'hard))))
- (delete-backward-char 1)
+ (delete-char -1)
(backward-char 1)
(setq oneleft t)))
(setq to (copy-marker (point) t))
@@ -1289,18 +1290,16 @@ otherwise it is made canonical."
(skip-chars-backward " "))
(setq ncols (- fc endcol))
;; Ncols is number of additional space chars needed
- (if (and (> ncols 0) (> nspaces 0) (not eop))
- (progn
- (setq curr-fracspace (+ ncols (/ (1+ nspaces) 2))
- count nspaces)
- (while (> count 0)
- (skip-chars-forward " ")
- (insert-and-inherit
- (make-string (/ curr-fracspace nspaces) ?\s))
- (search-forward " " nil t)
- (setq count (1- count)
- curr-fracspace
- (+ (% curr-fracspace nspaces) ncols)))))))
+ (when (and (> ncols 0) (> nspaces 0) (not eop))
+ (setq curr-fracspace (+ ncols (/ nspaces 2))
+ count nspaces)
+ (while (> count 0)
+ (skip-chars-forward " ")
+ (insert-char ?\s (/ curr-fracspace nspaces) t)
+ (search-forward " " nil t)
+ (setq count (1- count)
+ curr-fracspace
+ (+ (% curr-fracspace nspaces) ncols))))))
(t (error "Unknown justification value"))))
(goto-char pos)
(move-marker pos nil)))
@@ -1518,5 +1517,4 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines."
"")
string))
-;; arch-tag: 727ad455-1161-4fa9-8df5-0f74b179216d
;;; fill.el ends here
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 7b7787466f8..99c9a83e4fb 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1,7 +1,6 @@
;;; flyspell.el --- on-the-fly spell checker
-;; Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2011 Free Software Foundation, Inc.
;; Author: Manuel Serrano <Manuel.Serrano@sophia.inria.fr>
;; Maintainer: FSF
@@ -72,13 +71,23 @@ Detection of repeated words is not implemented in
:type 'boolean)
(defcustom flyspell-mark-duplications-exceptions
- '(("francais" . ("nous" "vous")))
+ '((nil . ("that" "had")) ; Common defaults for English.
+ ("\\`francais" . ("nous" "vous")))
"A list of exceptions for duplicated words.
-It should be a list of (LANGUAGE . EXCEPTION-LIST). LANGUAGE is matched
-against the current dictionary and EXCEPTION-LIST is a list of strings.
-The duplicated word is downcased before it is compared with the exceptions."
+It should be a list of (LANGUAGE . EXCEPTION-LIST).
+
+LANGUAGE is nil, which means the exceptions apply regardless of
+the current dictionary, or a regular expression matching the
+dictionary name (`ispell-local-dictionary' or
+`ispell-dictionary') for which the exceptions should apply.
+
+EXCEPTION-LIST is a list of strings. The checked word is
+downcased before comparing with these exceptions."
:group 'flyspell
- :type '(alist :key-type string :value-type (repeat string)))
+ :type '(alist :key-type (choice (const :tag "All dictionaries" nil)
+ string)
+ :value-type (repeat string))
+ :version "24.1")
(defcustom flyspell-sort-corrections nil
"Non-nil means, sort the corrections alphabetically before popping them."
@@ -199,9 +208,9 @@ Ispell's ultimate default dictionary."
(defcustom flyspell-check-tex-math-command nil
"Non-nil means check even inside TeX math environment.
-TeX math environments are discovered by the TEXMATHP that implemented
-inside the texmathp.el Emacs package. That package may be found at:
-http://strw.leidenuniv.nl/~dominik/Tools"
+TeX math environments are discovered by `texmathp', implemented
+inside AUCTeX package. That package may be found at
+URL `http://www.gnu.org/software/auctex/'"
:group 'flyspell
:type 'boolean)
@@ -380,7 +389,8 @@ like <img alt=\"Some thing.\">."
(defun flyspell-generic-progmode-verify ()
"Used for `flyspell-generic-check-word-predicate' in programming modes."
- (let ((f (get-text-property (point) 'face)))
+ ;; (point) is next char after the word. Must check one char before.
+ (let ((f (get-text-property (- (point) 1) 'face)))
(memq f flyspell-prog-text-faces)))
;;;###autoload
@@ -494,9 +504,9 @@ in your .emacs file.
:keymap flyspell-mode-map
:group 'flyspell
(if flyspell-mode
- (condition-case ()
+ (condition-case err
(flyspell-mode-on)
- (error (message "Enabling Flyspell mode gave an error")
+ (error (message "Error enabling Flyspell mode:\n%s" (cdr err))
(flyspell-mode -1)))
(flyspell-mode-off)))
@@ -1013,11 +1023,13 @@ Mostly we check word delimiters."
;;*---------------------------------------------------------------------*/
;;* flyspell-word ... */
;;*---------------------------------------------------------------------*/
-(defun flyspell-word (&optional following)
+(defun flyspell-word (&optional following known-misspelling)
"Spell check a word.
If the optional argument FOLLOWING, or, when called interactively
`ispell-following-word', is non-nil, checks the following (rather
-than preceding) word when the cursor is not over a word."
+than preceding) word when the cursor is not over a word. If
+optional argument KNOWN-MISSPELLING is non nil considers word a
+misspelling and skips redundant spell-checking step."
(interactive (list ispell-following-word))
(ispell-set-spellchecker-params) ; Initialize variables and dicts alists
(save-excursion
@@ -1042,12 +1054,14 @@ than preceding) word when the cursor is not over a word."
(not (memq (char-after (1- start)) '(?\} ?\\)))))
flyspell-mark-duplications-flag
(not (catch 'exception
- (dolist (except flyspell-mark-duplications-exceptions)
- (and (string= (or ispell-local-dictionary
- ispell-dictionary)
- (car except))
- (member (downcase word) (cdr except))
- (throw 'exception t)))))
+ (let ((dict (or ispell-local-dictionary
+ ispell-dictionary)))
+ (dolist (except flyspell-mark-duplications-exceptions)
+ (and (or (null (car except))
+ (and (stringp dict)
+ (string-match (car except) dict)))
+ (member (downcase word) (cdr except))
+ (throw 'exception t))))))
(save-excursion
(goto-char start)
(let* ((bound
@@ -1078,29 +1092,35 @@ than preceding) word when the cursor is not over a word."
(setq flyspell-word-cache-end end)
(setq flyspell-word-cache-word word)
;; now check spelling of word.
- (ispell-send-string "%\n")
- ;; put in verbose mode
- (ispell-send-string (concat "^" word "\n"))
- ;; we mark the ispell process so it can be killed
- ;; when emacs is exited without query
- (set-process-query-on-exit-flag ispell-process nil)
- ;; Wait until ispell has processed word. Since this code is often
- ;; executed from post-command-hook but the ispell process may not
- ;; be responsive, it's important to make sure we re-enable C-g.
- (with-local-quit
- (while (progn
- (accept-process-output ispell-process)
- (not (string= "" (car ispell-filter))))))
- ;; (ispell-send-string "!\n")
- ;; back to terse mode.
- ;; Remove leading empty element
- (setq ispell-filter (cdr ispell-filter))
- ;; ispell process should return something after word is sent.
- ;; Tag word as valid (i.e., skip) otherwise
- (or ispell-filter
- (setq ispell-filter '(*)))
- (if (consp ispell-filter)
- (setq poss (ispell-parse-output (car ispell-filter))))
+ (if (not known-misspelling)
+ (progn
+ (ispell-send-string "%\n")
+ ;; put in verbose mode
+ (ispell-send-string (concat "^" word "\n"))
+ ;; we mark the ispell process so it can be killed
+ ;; when emacs is exited without query
+ (set-process-query-on-exit-flag ispell-process nil)
+ ;; Wait until ispell has processed word. Since this
+ ;; code is often executed from post-command-hook but
+ ;; the ispell process may not be responsive, it's
+ ;; important to make sure we re-enable C-g.
+ (with-local-quit
+ (while (progn
+ (accept-process-output ispell-process)
+ (not (string= "" (car ispell-filter))))))
+ ;; (ispell-send-string "!\n")
+ ;; back to terse mode.
+ ;; Remove leading empty element
+ (setq ispell-filter (cdr ispell-filter))
+ ;; ispell process should return something after word is sent.
+ ;; Tag word as valid (i.e., skip) otherwise
+ (or ispell-filter
+ (setq ispell-filter '(*)))
+ (if (consp ispell-filter)
+ (setq poss (ispell-parse-output (car ispell-filter)))))
+ ;; Else, this was a known misspelling to begin with, and
+ ;; we should forge an ispell return value.
+ (setq poss (list word 0 '() '())))
(let ((res (cond ((eq poss t)
;; correct
(setq flyspell-word-cache-result t)
@@ -1433,7 +1453,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
t
nil))))
(setq keep nil)
- (flyspell-word)
+ (flyspell-word nil t)
;; Search for next misspelled word will begin from
;; end of last validated match.
(setq buffer-scan-pos (point))))
@@ -1465,7 +1485,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
(goto-char (point-min))
;; Localwords parsing copied from ispell.el.
(while (search-forward ispell-words-keyword nil t)
- (let ((end (save-excursion (end-of-line) (point)))
+ (let ((end (point-at-eol))
string)
;; buffer-local words separated by a space, and can contain
;; any character other than a space. Not rigorous enough.
@@ -1817,7 +1837,9 @@ misspelled words backwards."
(throw 'exit t)))))))
(save-excursion
(goto-char pos)
- (ispell-word))
+ (ispell-word)
+ (setq flyspell-word-cache-word nil) ;; Force flyspell-word re-check
+ (flyspell-word))
(error "No word to correct before point"))))
;;*---------------------------------------------------------------------*/
@@ -2352,5 +2374,4 @@ This function is meant to be added to `flyspell-incorrect-hook'."
(provide 'flyspell)
-;; arch-tag: 05d915b9-e9cf-44fb-9137-fc28f5eaab2a
;;; flyspell.el ends here
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 7feccde54ec..c196218feec 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1,7 +1,6 @@
;;; ispell.el --- interface to International Ispell Versions 3.1 and 3.2
-;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1995, 1997-2011 Free Software Foundation, Inc.
;; Author: Ken Stevens <k.stevens@ieee.org>
;; Maintainer: Ken Stevens <k.stevens@ieee.org>
@@ -221,10 +220,10 @@ compatibility function in case `version<=' is not available."
(let (ver mver)
(if (string-match "[0-9]+" version start-ver)
(setq start-ver (match-end 0)
- ver (string-to-number (substring version (match-beginning 0) (match-end 0)))))
+ ver (string-to-number (match-string 0 version))))
(if (string-match "[0-9]+" minver start-mver)
(setq start-mver (match-end 0)
- mver (string-to-number (substring minver (match-beginning 0) (match-end 0)))))
+ mver (string-to-number (match-string 0 minver))))
(if (or ver mver)
(progn
@@ -310,7 +309,9 @@ Warning! Not checking comments, when a comment start is embedded in strings,
may produce undesired results."
:type '(choice (const exclusive) (const :tag "off" nil) (const :tag "on" t))
:group 'ispell)
-;;;###autoload(put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
+;;;###autoload
+(put 'ispell-check-comments 'safe-local-variable
+ (lambda (a) (memq a '(nil t exclusive))))
(defcustom ispell-query-replace-choices nil
"*Corrections made throughout region when non-nil.
@@ -357,21 +358,21 @@ Must be greater than 1."
:group 'ispell)
(defcustom ispell-alternate-dictionary
- (cond ((file-exists-p "/usr/dict/web2") "/usr/dict/web2")
- ((file-exists-p "/usr/share/dict/web2") "/usr/share/dict/web2")
- ((file-exists-p "/usr/dict/words") "/usr/dict/words")
- ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words")
- ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words")
- ((file-exists-p "/usr/share/lib/dict/words")
+ (cond ((file-readable-p "/usr/dict/web2") "/usr/dict/web2")
+ ((file-readable-p "/usr/share/dict/web2") "/usr/share/dict/web2")
+ ((file-readable-p "/usr/dict/words") "/usr/dict/words")
+ ((file-readable-p "/usr/lib/dict/words") "/usr/lib/dict/words")
+ ((file-readable-p "/usr/share/dict/words") "/usr/share/dict/words")
+ ((file-readable-p "/usr/share/lib/dict/words")
"/usr/share/lib/dict/words")
- ((file-exists-p "/sys/dict") "/sys/dict")
- (t "/usr/dict/words"))
- "*Alternate dictionary for spelling help."
+ ((file-readable-p "/sys/dict") "/sys/dict"))
+ "*Alternate plain word-list dictionary for spelling help."
:type '(choice file (const :tag "None" nil))
:group 'ispell)
-(defcustom ispell-complete-word-dict ispell-alternate-dictionary
- "*Dictionary used for word completion."
+(defcustom ispell-complete-word-dict nil
+ "*Plain word-list dictionary used for word completion if
+different from `ispell-alternate-dictionary'."
:type '(choice file (const :tag "None" nil))
:group 'ispell)
@@ -514,7 +515,8 @@ is automatically set when defined in the file with either
:type '(choice string
(const :tag "default" nil))
:group 'ispell)
-;;;###autoload(put 'ispell-local-dictionary 'safe-local-variable 'string-or-null-p)
+;;;###autoload
+(put 'ispell-local-dictionary 'safe-local-variable 'string-or-null-p)
(make-variable-buffer-local 'ispell-local-dictionary)
@@ -660,8 +662,8 @@ re-start Emacs."
"[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
"[.]" nil nil nil iso-8859-2)
("portugues" ; Portuguese mode
- "[a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]"
- "[^a-zA-Z\301\302\311\323\340\341\342\351\352\355\363\343\372]"
+ "[a-zA-Z\301\302\307\311\323\340\341\342\351\352\355\363\343\347\372]"
+ "[^a-zA-Z\301\302\307\311\323\340\341\342\351\352\355\363\343\347\372]"
"[']" t ("-C") "~latin1" iso-8859-1)
("russian" ; Russian.aff (KOI8-R charset)
"[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
@@ -738,8 +740,8 @@ Note that the CASECHARS and OTHERCHARS slots of the alist should
contain the same character set as casechars and otherchars in the
LANGUAGE.aff file \(e.g., english.aff\).")
-(defvar ispell-really-aspell nil) ; Non-nil if aspell extensions should be used
-(defvar ispell-really-hunspell nil) ; Non-nil if hunspell extensions should be used
+(defvar ispell-really-aspell nil) ; Non-nil if we can use aspell extensions.
+(defvar ispell-really-hunspell nil) ; Non-nil if we can use hunspell extensions.
(defvar ispell-encoding8-command nil
"Command line option prefix to select UTF-8 if supported, nil otherwise.
If UTF-8 if supported by spellchecker and is selectable from the command line
@@ -767,8 +769,8 @@ here just for backwards compatibility.")
-;;; The version must be 3.1 or greater for this version of ispell.el
-;;; There is an incompatibility between version 3.1.12 and lower versions.
+;; The version must be 3.1 or greater for this version of ispell.el
+;; There is an incompatibility between version 3.1.12 and lower versions.
(defconst ispell-required-version '(3 1 12)
"Ispell versions with which this version of ispell.el is known to work.")
(defvar ispell-offset -1
@@ -962,7 +964,8 @@ Internal use.")
(setq found (nconc found (list dict)))))
(setq ispell-aspell-dictionary-alist found)
;; Add a default entry
- (let ((default-dict '(nil "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil utf-8)))
+ (let ((default-dict
+ '(nil "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil utf-8)))
(push default-dict ispell-aspell-dictionary-alist))))
(defvar ispell-aspell-data-dir nil
@@ -979,19 +982,32 @@ Assumes that value contains no whitespace."
(car (split-string (buffer-string)))))
(defun ispell-aspell-find-dictionary (dict-name)
- ;; This returns nil if the data file does not exist.
- ;; Can someone please explain the return value format when the
- ;; file does exist -- rms?
- (let* ((lang ;; Strip out region, variant, etc.
- (and (string-match "^[[:alpha:]]+" dict-name)
- (match-string 0 dict-name)))
+ "For aspell dictionary DICT-NAME, return a list of parameters if an
+ associated data file is found or nil otherwise. List format is
+ that of `ispell-dictionary-base-alist' elements."
+ ;; Make sure `ispell-aspell-data-dir' is defined
+ (or ispell-aspell-data-dir
+ (setq ispell-aspell-data-dir
+ (ispell-get-aspell-config-value "data-dir")))
+ ;; Try finding associated datafile
+ (let* ((datafile1
+ (concat ispell-aspell-data-dir "/"
+ ;; Strip out variant, country code, etc.
+ (and (string-match "^[[:alpha:]]+" dict-name)
+ (match-string 0 dict-name)) ".dat"))
+ (datafile2
+ (concat ispell-aspell-data-dir "/"
+ ;; Strip out anything but xx_YY.
+ (and (string-match "^[[:alpha:]_]+" dict-name)
+ (match-string 0 dict-name)) ".dat"))
(data-file
- (concat (or ispell-aspell-data-dir
- (setq ispell-aspell-data-dir
- (ispell-get-aspell-config-value "data-dir")))
- "/" lang ".dat"))
+ (if (file-readable-p datafile1)
+ datafile1
+ (if (file-readable-p datafile2)
+ datafile2)))
otherchars)
- (condition-case ()
+
+ (if data-file
(with-temp-buffer
(insert-file-contents data-file)
;; There is zero or one line with special characters declarations.
@@ -1019,14 +1035,13 @@ Assumes that value contains no whitespace."
;; Here we specify the encoding to use while communicating with
;; aspell. This doesn't apply to command line arguments, so
;; just don't pass words to spellcheck as arguments...
- 'utf-8))
- (file-error
- nil))))
+ 'utf-8)))))
(defun ispell-aspell-add-aliases (alist)
"Find aspell's dictionary aliases and add them to dictionary ALIST.
Return the new dictionary alist."
- (let ((aliases (file-expand-wildcards
+ (let ((aliases
+ (file-expand-wildcards
(concat (or ispell-aspell-dict-dir
(setq ispell-aspell-dict-dir
(ispell-get-aspell-config-value "dict-dir")))
@@ -1101,7 +1116,7 @@ aspell is used along with Emacs).")
(defun ispell-valid-dictionary-list ()
- "Returns a list of valid dictionaries.
+ "Return a list of valid dictionaries.
The variable `ispell-library-directory' defines the library location."
;; Initialize variables and dictionaries alists for desired spellchecker.
;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs
@@ -1111,26 +1126,24 @@ The variable `ispell-library-directory' defines the library location."
(let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
(dict-list (cons "default" nil))
- name load-dict)
+ name dict-bname)
(dolist (dict dicts)
(setq name (car dict)
- load-dict (car (cdr (member "-d" (nth 5 dict)))))
+ dict-bname (or (car (cdr (member "-d" (nth 5 dict))))
+ name))
;; Include if the dictionary is in the library, or dir not defined.
(if (and
name
- ;; include all dictionaries if lib directory not known.
;; For Aspell, we already know which dictionaries exist.
(or ispell-really-aspell
+ ;; Include all dictionaries if lib directory not known.
+ ;; Same for Hunspell, where ispell-library-directory is nil.
(not ispell-library-directory)
(file-exists-p (concat ispell-library-directory
- "/" name ".hash"))
- (file-exists-p (concat ispell-library-directory "/" name ".has"))
- (and load-dict
- (or (file-exists-p (concat ispell-library-directory
- "/" load-dict ".hash"))
- (file-exists-p (concat ispell-library-directory
- "/" load-dict ".has"))))))
- (setq dict-list (cons name dict-list))))
+ "/" dict-bname ".hash"))
+ (file-exists-p (concat ispell-library-directory
+ "/" dict-bname ".has"))))
+ (push name dict-list)))
dict-list))
;;; define commands in menu in opposite order you want them to appear.
@@ -1168,7 +1181,8 @@ The variable `ispell-library-directory' defines the library location."
`(menu-item ,(purecopy "Complete Word") ispell-complete-word
:help ,(purecopy "Complete word at cursor using dictionary")))
(define-key ispell-menu-map [ispell-complete-word-interior-frag]
- `(menu-item ,(purecopy "Complete Word Fragment") ispell-complete-word-interior-frag
+ `(menu-item ,(purecopy "Complete Word Fragment")
+ ispell-complete-word-interior-frag
:help ,(purecopy "Complete word fragment at cursor")))))
;;;###autoload
@@ -1185,7 +1199,8 @@ The variable `ispell-library-directory' defines the library location."
`(menu-item ,(purecopy "Spell-Check Word") ispell-word
:help ,(purecopy "Spell-check word at cursor")))
(define-key ispell-menu-map [ispell-comments-and-strings]
- `(menu-item ,(purecopy "Spell-Check Comments") ispell-comments-and-strings
+ `(menu-item ,(purecopy "Spell-Check Comments")
+ ispell-comments-and-strings
:help ,(purecopy "Spell-check only comments and strings")))))
;;;###autoload
@@ -1264,9 +1279,6 @@ The variable `ispell-library-directory' defines the library location."
;;; **********************************************************************
-
-;;; This variable contains the current dictionary being used if the ispell
-;;; process is running.
(defvar ispell-current-dictionary nil
"The name of the current dictionary, or nil for the default.
This is passed to the ispell process using the `-d' switch and is
@@ -1291,6 +1303,7 @@ Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
;; Return a string decoded from Nth element of the current dictionary.
(defun ispell-get-decoded-string (n)
+ "Get the decoded string in slot N of the descriptor of the current dict."
(let* ((slot (or
(assoc ispell-current-dictionary ispell-local-dictionary-alist)
(assoc ispell-current-dictionary ispell-dictionary-alist)
@@ -1397,7 +1410,8 @@ The last occurring definition in the buffer will be used.")
(ispell-dictionary-keyword forward-line)
(ispell-pdict-keyword forward-line)
(ispell-parsing-keyword forward-line)
- (,(purecopy "^---*BEGIN PGP [A-Z ]*--*") . ,(purecopy "^---*END PGP [A-Z ]*--*"))
+ (,(purecopy "^---*BEGIN PGP [A-Z ]*--*")
+ . ,(purecopy "^---*END PGP [A-Z ]*--*"))
;; assume multiline uuencoded file? "\nM.*$"?
(,(purecopy "^begin [0-9][0-9][0-9] [^ \t]+$") . ,(purecopy "\nend\n"))
(,(purecopy "^%!PS-Adobe-[123].0") . ,(purecopy "\n%%EOF\n"))
@@ -1877,9 +1891,10 @@ Global `ispell-quit' set to start location to continue spell session."
;; setup the *Choices* buffer with valid data.
(with-current-buffer (get-buffer-create ispell-choices-buffer)
(setq mode-line-format
- (concat "-- %b -- word: " word
- " -- dict: " (or ispell-current-dictionary "default")
- " -- prog: " (file-name-nondirectory ispell-program-name)))
+ (concat
+ "-- %b -- word: " word
+ " -- dict: " (or ispell-current-dictionary "default")
+ " -- prog: " (file-name-nondirectory ispell-program-name)))
;; XEmacs: no need for horizontal scrollbar in choices window
(with-no-warnings
(and (fboundp 'set-specifier)
@@ -2046,10 +2061,11 @@ Global `ispell-quit' set to start location to continue spell session."
(erase-buffer)
(setq count ?0
skipped 0
- mode-line-format
+ mode-line-format ;; setup the *Choices* buffer with valid data.
(concat "-- %b -- word: " new-word
- " -- dict: "
- ispell-alternate-dictionary)
+ " -- word-list: "
+ (or ispell-complete-word-dict
+ ispell-alternate-dictionary))
miss (lookup-words new-word)
choices miss
line ispell-choices-win-default-height)
@@ -2143,7 +2159,7 @@ Global `ispell-quit' set to start location to continue spell session."
(if (and ispell-use-framepop-p (fboundp 'framepop-display-buffer))
(progn
(framepop-display-buffer (get-buffer ispell-choices-buffer))
-;;; (get-buffer-window ispell-choices-buffer t)
+ ;; (get-buffer-window ispell-choices-buffer t)
(select-window (previous-window))) ; *Choices* window
;; standard selection by splitting a small buffer out of this window.
(let ((choices-window (get-buffer-window ispell-choices-buffer)))
@@ -2264,71 +2280,75 @@ Otherwise the variable `ispell-grep-command' contains the command used to
search for the words (usually egrep).
Optional second argument contains the dictionary to use; the default is
-`ispell-alternate-dictionary'."
+`ispell-alternate-dictionary', overriden by `ispell-complete-word-dict'
+if defined."
;; We don't use the filter for this function, rather the result is written
;; into a buffer. Hence there is no need to save the filter values.
(if (null lookup-dict)
- (setq lookup-dict ispell-alternate-dictionary))
+ (setq lookup-dict (or ispell-complete-word-dict
+ ispell-alternate-dictionary)))
+
+ (if lookup-dict
+ (unless (file-readable-p lookup-dict)
+ (error "lookup-words error: Unreadable or missing plain word-list %s."
+ lookup-dict))
+ (error (concat "lookup-words error: No plain word-list found at system"
+ "default locations. "
+ "Customize `ispell-alternate-dictionary' to set yours.")))
(let* ((process-connection-type ispell-use-ptys-p)
(wild-p (string-match "\\*" word))
(look-p (and ispell-look-p ; Only use look for an exact match.
(or ispell-have-new-look (not wild-p))))
- (ispell-grep-buffer (get-buffer-create "*Ispell-Temp*")) ; result buf
(prog (if look-p ispell-look-command ispell-grep-command))
(args (if look-p ispell-look-options ispell-grep-options))
status results loc)
- (unwind-protect
- (save-window-excursion
- (message "Starting \"%s\" process..." (file-name-nondirectory prog))
- (set-buffer ispell-grep-buffer)
- (if look-p
- nil
- ;; convert * to .*
- (insert "^" word "$")
- (while (search-backward "*" nil t) (insert "."))
- (setq word (buffer-string))
- (erase-buffer))
- (setq status (apply 'ispell-call-process prog nil t nil
- (nconc (if (and args (> (length args) 0))
- (list args)
- (if look-p nil
- (list "-e")))
- (list word)
- (if lookup-dict (list lookup-dict)))))
- ;; grep returns status 1 and no output when word not found, which
- ;; is a perfectly normal thing.
- (if (stringp status)
- (setq results (cons (format "error: %s exited with signal %s"
- (file-name-nondirectory prog) status)
- results))
- ;; else collect words into `results' in FIFO order
- (goto-char (point-max))
- ;; assure we've ended with \n
- (or (bobp) (= (preceding-char) ?\n) (insert ?\n))
- (while (not (bobp))
- (setq loc (point))
- (forward-line -1)
- (setq results (cons (buffer-substring-no-properties (point)
- (1- loc))
- results)))))
- ;; protected
- (kill-buffer ispell-grep-buffer)
- (if (and results (string-match ".+: " (car results)))
- (error "%s error: %s" ispell-grep-command (car results))))
+ (with-temp-buffer
+ (message "Starting \"%s\" process..." (file-name-nondirectory prog))
+ (if look-p
+ nil
+ ;; Convert * to .*
+ (insert "^" word "$")
+ (while (search-backward "*" nil t) (insert "."))
+ (setq word (buffer-string))
+ (erase-buffer))
+ (setq status (apply 'ispell-call-process prog nil t nil
+ (nconc (if (and args (> (length args) 0))
+ (list args)
+ (if look-p nil
+ (list "-e")))
+ (list word)
+ (if lookup-dict (list lookup-dict)))))
+ ;; `grep' returns status 1 and no output when word not found, which
+ ;; is a perfectly normal thing.
+ (if (stringp status)
+ (error "error: %s exited with signal %s"
+ (file-name-nondirectory prog) status)
+ ;; Else collect words into `results' in FIFO order.
+ (goto-char (point-max))
+ ;; Assure we've ended with \n.
+ (or (bobp) (= (preceding-char) ?\n) (insert ?\n))
+ (while (not (bobp))
+ (setq loc (point))
+ (forward-line -1)
+ (push (buffer-substring-no-properties (point)
+ (1- loc))
+ results))))
+ (if (and results (string-match ".+: " (car results)))
+ (error "%s error: %s" ispell-grep-command (car results)))
results))
-;;; "ispell-filter" is a list of output lines from the generating function.
-;;; Each full line (ending with \n) is a separate item on the list.
-;;; "output" can contain multiple lines, part of a line, or both.
-;;; "start" and "end" are used to keep bounds on lines when "output" contains
-;;; multiple lines.
-;;; "ispell-filter-continue" is true when we have received only part of a
-;;; line as output from a generating function ("output" did not end with \n)
-;;; THIS FUNCTION WILL FAIL IF THE PROCESS OUTPUT DOESN'T END WITH \n!
-;;; This is the case when a process dies or fails. The default behavior
-;;; in this case treats the next input received as fresh input.
+;; "ispell-filter" is a list of output lines from the generating function.
+;; Each full line (ending with \n) is a separate item on the list.
+;; "output" can contain multiple lines, part of a line, or both.
+;; "start" and "end" are used to keep bounds on lines when "output" contains
+;; multiple lines.
+;; "ispell-filter-continue" is true when we have received only part of a
+;; line as output from a generating function ("output" did not end with \n)
+;; THIS FUNCTION WILL FAIL IF THE PROCESS OUTPUT DOESN'T END WITH \n!
+;; This is the case when a process dies or fails. The default behavior
+;; in this case treats the next input received as fresh input.
(defun ispell-filter (process output)
"Output filter function for ispell, grep, and look."
@@ -2528,18 +2548,18 @@ Optional third arg SHIFT is an offset to apply based on previous corrections."
(setq count (string-to-number output) ; get number of misses.
output (substring output (1+ (string-match " " output 1)))))
(setq offset (string-to-number output))
- (if (eq type ?#) ; No miss or guess list.
- (setq output nil)
- (setq output (substring output (1+ (string-match " " output 1)))))
+ (setq output (if (eq type ?#) ; No miss or guess list.
+ nil
+ (substring output (1+ (string-match " " output 1)))))
(while output
(let ((end (string-match ", \\|\\($\\)" output))) ; end of miss/guess.
(setq cur-count (1+ cur-count))
(if (> cur-count count)
- (setq guess-list (cons (substring output 0 end) guess-list))
- (setq miss-list (cons (substring output 0 end) miss-list)))
- (if (match-end 1) ; True only when at end of line.
- (setq output nil) ; no more misses or guesses
- (setq output (substring output (+ end 2))))))
+ (push (substring output 0 end) guess-list)
+ (push (substring output 0 end) miss-list))
+ (setq output (if (match-end 1) ; True only when at end of line.
+ nil ; No more misses or guesses.
+ (substring output (+ end 2))))))
;; return results. Accept word if it was already accepted.
;; adjust offset.
(if (member original-word accept-list)
@@ -2560,37 +2580,35 @@ When asynchronous processes are not supported, `run' is always returned."
(defun ispell-start-process ()
"Start the ispell process, with support for no asynchronous processes.
Keeps argument list for future ispell invocations for no async support."
- (let ((default-directory default-directory)
- args)
- (unless (and (file-directory-p default-directory)
- (file-readable-p default-directory))
- ;; Defend against bad `default-directory'.
- (setq default-directory (expand-file-name "~/")))
- ;; Local dictionary becomes the global dictionary in use.
- (setq ispell-current-dictionary
- (or ispell-local-dictionary ispell-dictionary))
- (setq ispell-current-personal-dictionary
- (or ispell-local-pdict ispell-personal-dictionary))
- (setq args (ispell-get-ispell-args))
- (if (and ispell-current-dictionary ; use specified dictionary
- (not (member "-d" args))) ; only define if not overridden
- (setq args
- (append (list "-d" ispell-current-dictionary) args)))
- (if ispell-current-personal-dictionary ; use specified pers dict
- (setq args
- (append args
- (list "-p"
- (expand-file-name ispell-current-personal-dictionary)))))
-
- ;; If we are using recent aspell or hunspell, make sure we use the right encoding
- ;; for communication. ispell or older aspell/hunspell does not support this
- (if ispell-encoding8-command
- (setq args
- (append args
- (list
- (concat ispell-encoding8-command
- (symbol-name (ispell-get-coding-system)))))))
- (setq args (append args ispell-extra-args))
+ ;; Local dictionary becomes the global dictionary in use.
+ (setq ispell-current-dictionary
+ (or ispell-local-dictionary ispell-dictionary))
+ (setq ispell-current-personal-dictionary
+ (or ispell-local-pdict ispell-personal-dictionary))
+ (let* ((default-directory
+ (if (and (file-directory-p default-directory)
+ (file-readable-p default-directory))
+ default-directory
+ ;; Defend against bad `default-directory'.
+ (expand-file-name "~/")))
+ (orig-args (ispell-get-ispell-args))
+ (args
+ (append
+ (if (and ispell-current-dictionary ; Not for default dict (nil)
+ (not (member "-d" orig-args))) ; Only define if not overridden.
+ (list "-d" ispell-current-dictionary))
+ orig-args
+ (if ispell-current-personal-dictionary ; Use specified pers dict.
+ (list "-p"
+ (expand-file-name ispell-current-personal-dictionary)))
+ ;; If we are using recent aspell or hunspell, make sure we use the
+ ;; right encoding for communication. ispell or older aspell/hunspell
+ ;; does not support this.
+ (if ispell-encoding8-command
+ (list
+ (concat ispell-encoding8-command
+ (symbol-name (ispell-get-coding-system)))))
+ ispell-extra-args)))
;; Initially we don't know any buffer's local words.
(setq ispell-buffer-local-name nil)
@@ -2599,9 +2617,11 @@ Keeps argument list for future ispell invocations for no async support."
(let ((process-connection-type ispell-use-ptys-p))
(apply 'start-process
"ispell" nil ispell-program-name
- "-a" ; accept single input lines
- (if ispell-really-hunspell "" "-m") ; make root/affix combos not in dict
- args)) ; hunspell -m option means different
+ "-a" ; Accept single input lines.
+ ;; Make root/affix combos not in dict.
+ ;; hunspell -m option means different.
+ (if ispell-really-hunspell "" "-m")
+ args))
(setq ispell-cmd-args args
ispell-output-buffer (generate-new-buffer " *ispell-output*")
ispell-session-buffer (generate-new-buffer " *ispell-session*"))
@@ -2609,65 +2629,114 @@ Keeps argument list for future ispell invocations for no async support."
t)))
-
(defun ispell-init-process ()
"Check status of Ispell process and start if necessary."
- (if (and ispell-process
- (eq (ispell-process-status) 'run)
- ;; If we're using a personal dictionary, ensure
- ;; we're in the same default directory!
- (or (not ispell-personal-dictionary)
- (equal ispell-process-directory default-directory)))
- (setq ispell-filter nil ispell-filter-continue nil)
- ;; may need to restart to select new personal dictionary.
- (ispell-kill-ispell t)
- (message "Starting new Ispell process [%s] ..."
- (or ispell-local-dictionary ispell-dictionary "default"))
- (sit-for 0)
- (setq ispell-library-directory (ispell-check-version)
- ispell-process-directory default-directory
- ispell-process (ispell-start-process)
- ispell-filter nil
- ispell-filter-continue nil)
- (if ispell-async-processp
- (set-process-filter ispell-process 'ispell-filter))
- ;; protect against bogus binding of `enable-multibyte-characters' in XEmacs
- (if (and (or (featurep 'xemacs)
- (and (boundp 'enable-multibyte-characters)
- enable-multibyte-characters))
- (fboundp 'set-process-coding-system))
- (set-process-coding-system ispell-process (ispell-get-coding-system)
- (ispell-get-coding-system)))
- ;; Get version ID line
- (ispell-accept-output 3)
- ;; get more output if filter empty?
- (if (null ispell-filter) (ispell-accept-output 3))
- (cond ((null ispell-filter)
- (error "%s did not output version line" ispell-program-name))
- ((and
- (stringp (car ispell-filter))
- (if (string-match "warning: " (car ispell-filter))
- (progn
- (ispell-accept-output 3) ; was warn msg.
- (stringp (car ispell-filter)))
- (null (cdr ispell-filter)))
- (string-match "^@(#) " (car ispell-filter)))
- ;; got the version line as expected (we already know it's the right
- ;; version, so don't bother checking again.)
- nil)
- (t
- ;; Otherwise, it must be an error message. Show the user.
- ;; But first wait to see if some more output is going to arrive.
- ;; Otherwise we get cool errors like "Can't open ".
- (sleep-for 1)
- (ispell-accept-output 3)
- (error "%s" (mapconcat 'identity ispell-filter "\n"))))
- (setq ispell-filter nil) ; Discard version ID line
- (let ((extended-char-mode (ispell-get-extended-character-mode)))
- (if extended-char-mode ; ~ extended character mode
- (ispell-send-string (concat extended-char-mode "\n"))))
- (if ispell-async-processp
- (set-process-query-on-exit-flag ispell-process nil))))
+ (let* (;; Basename of dictionary used by the spell-checker
+ (dict-bname (or (car (cdr (member "-d" (ispell-get-ispell-args))))
+ ispell-current-dictionary))
+ ;; Use "~/" as default-directory unless using Ispell with per-dir
+ ;; personal dictionaries and not in a minibuffer under XEmacs
+ (default-directory
+ (if (or ispell-really-aspell
+ ispell-really-hunspell
+ ;; Protect against bad default-directory
+ (not (and (file-directory-p default-directory)
+ (file-readable-p default-directory)))
+ ;; Ispell and per-dir personal dicts available
+ (not (or (file-readable-p (concat default-directory
+ ".ispell_words"))
+ (file-readable-p (concat default-directory
+ ".ispell_"
+ (or dict-bname
+ "default")))))
+ ;; Ispell, in a minibuffer, and XEmacs
+ (and (window-minibuffer-p)
+ (not (fboundp 'minibuffer-selected-window))))
+ (expand-file-name "~/")
+ (expand-file-name default-directory))))
+ ;; Check if process needs restart
+ (if (and ispell-process
+ (eq (ispell-process-status) 'run)
+ ;; Unless we are using an explicit personal dictionary, ensure
+ ;; we're in the same default directory! Restart check for
+ ;; personal dictionary is done in
+ ;; `ispell-internal-change-dictionary', called from
+ ;; `ispell-buffer-local-dict'
+ (or (or ispell-local-pdict ispell-personal-dictionary)
+ (equal ispell-process-directory default-directory)))
+ (setq ispell-filter nil ispell-filter-continue nil)
+ ;; may need to restart to select new personal dictionary.
+ (ispell-kill-ispell t)
+ (message "Starting new Ispell process [%s] ..."
+ (or ispell-local-dictionary ispell-dictionary "default"))
+ (sit-for 0)
+ (setq ispell-library-directory (ispell-check-version)
+ ispell-process (ispell-start-process)
+ ispell-filter nil
+ ispell-filter-continue nil
+ ispell-process-directory default-directory)
+
+ (unless (equal ispell-process-directory (expand-file-name "~/"))
+ ;; At this point, `ispell-process-directory' will be "~/" unless using
+ ;; Ispell with directory-specific dicts and not in XEmacs minibuffer.
+ ;; If not, kill ispell process when killing buffer. It may be in a
+ ;; removable device that would otherwise become un-mountable.
+ (with-current-buffer
+ (if (and (window-minibuffer-p) ;; In minibuffer
+ (fboundp 'minibuffer-selected-window)) ;; Not XEmacs.
+ ;; In this case kill ispell only when parent buffer is killed
+ ;; to avoid over and over ispell kill.
+ (window-buffer (minibuffer-selected-window))
+ (current-buffer))
+ ;; 'local does not automatically make hook buffer-local in XEmacs.
+ (if (featurep 'xemacs)
+ (make-local-hook 'kill-buffer-hook))
+ (add-hook 'kill-buffer-hook
+ (lambda () (ispell-kill-ispell t)) nil 'local)))
+
+ (if ispell-async-processp
+ (set-process-filter ispell-process 'ispell-filter))
+ ;; Protect against XEmacs bogus binding of `enable-multibyte-characters'.
+ (if (and (or (featurep 'xemacs)
+ (and (boundp 'enable-multibyte-characters)
+ enable-multibyte-characters))
+ (fboundp 'set-process-coding-system))
+ (set-process-coding-system ispell-process (ispell-get-coding-system)
+ (ispell-get-coding-system)))
+ ;; Get version ID line
+ (ispell-accept-output 3)
+ ;; get more output if filter empty?
+ (if (null ispell-filter) (ispell-accept-output 3))
+ (cond ((null ispell-filter)
+ (error "%s did not output version line" ispell-program-name))
+ ((and
+ (stringp (car ispell-filter))
+ (if (string-match "warning: " (car ispell-filter))
+ (progn
+ (ispell-accept-output 3) ; was warn msg.
+ (stringp (car ispell-filter)))
+ (null (cdr ispell-filter)))
+ (string-match "^@(#) " (car ispell-filter)))
+ ;; got the version line as expected (we already know it's the right
+ ;; version, so don't bother checking again.)
+ nil)
+ (t
+ ;; Otherwise, it must be an error message. Show the user.
+ ;; But first wait to see if some more output is going to arrive.
+ ;; Otherwise we get cool errors like "Can't open ".
+ (sleep-for 1)
+ (ispell-accept-output 3)
+ (error "%s" (mapconcat 'identity ispell-filter "\n"))))
+ (setq ispell-filter nil) ; Discard version ID line
+ (let ((extended-char-mode (ispell-get-extended-character-mode)))
+ (if extended-char-mode ; ~ extended character mode
+ (ispell-send-string (concat extended-char-mode "\n"))))
+ (if ispell-async-processp
+ (if (featurep 'emacs)
+ (set-process-query-on-exit-flag ispell-process nil)
+ (if (fboundp 'set-process-query-on-exit-flag)
+ (set-process-query-on-exit-flag ispell-process nil)
+ (process-kill-without-query ispell-process)))))))
;;;###autoload
(defun ispell-kill-ispell (&optional no-error)
@@ -2693,7 +2762,6 @@ With NO-ERROR, just return non-nil if there was no Ispell running."
(message "Ispell process killed")
nil))
-
;;; ispell-change-dictionary is set in some people's hooks. Maybe this should
;;; call ispell-init-process rather than wait for a spell checking command?
@@ -2754,7 +2822,11 @@ a new one will be started when needed."
(setq ispell-current-dictionary dict
ispell-current-personal-dictionary pdict))))
-;;; Spelling of comments are checked when ispell-check-comments is non-nil.
+;; Avoid error messages when compiling for these dynamic variables.
+(defvar ispell-start)
+(defvar ispell-end)
+
+;; Spelling of comments are checked when ispell-check-comments is non-nil.
;;;###autoload
(defun ispell-region (reg-start reg-end &optional recheckp shift)
@@ -2785,14 +2857,14 @@ Return nil if spell session is quit,
(message "searching for regions to skip"))
(if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t)
(progn
- (setq key (buffer-substring-no-properties
- (match-beginning 0) (match-end 0)))
+ (setq key (match-string-no-properties 0))
(set-marker skip-region-start (- (point) (length key)))
(goto-char reg-start)))
(let (message-log-max)
- (message "Continuing spelling check using %s with %s dictionary..."
- (file-name-nondirectory ispell-program-name)
- (or ispell-current-dictionary "default")))
+ (message
+ "Continuing spelling check using %s with %s dictionary..."
+ (file-name-nondirectory ispell-program-name)
+ (or ispell-current-dictionary "default")))
(set-marker rstart reg-start)
(set-marker ispell-region-end reg-end)
(while (and (not ispell-quit)
@@ -2831,18 +2903,19 @@ Return nil if spell session is quit,
(if (marker-position skip-region-start)
(min skip-region-start ispell-region-end)
(marker-position ispell-region-end))))
- (let* ((start (point))
- (end (save-excursion (end-of-line) (min (point) reg-end)))
- (string (ispell-get-line start end in-comment)))
+ (let* ((ispell-start (point))
+ (ispell-end (min (point-at-eol) reg-end))
+ (string (ispell-get-line
+ ispell-start ispell-end in-comment)))
(if in-comment ; account for comment chars added
- (setq start (- start (length in-comment))
+ (setq ispell-start (- ispell-start (length in-comment))
in-comment nil))
- (setq end (point)) ; "end" tracks region retrieved.
+ (setq ispell-end (point)) ; "end" tracks region retrieved.
(if string ; there is something to spell check!
;; (special start end)
(setq shift (ispell-process-line string
(and recheckp shift))))
- (goto-char end)))))
+ (goto-char ispell-end)))))
(if ispell-quit
nil
(or shift 0)))
@@ -2879,42 +2952,30 @@ Return nil if spell session is quit,
"Return a regexp of the search keys for region skipping.
Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys.
Must call after `ispell-buffer-local-parsing' due to dependence on mode."
- ;; start with regions generic to all buffers
- (let ((skip-regexp (ispell-begin-skip-region ispell-skip-region-alist)))
- ;; Comments
- (if (and (null ispell-check-comments) comment-start)
- (setq skip-regexp (concat (regexp-quote comment-start) "\\|"
- skip-regexp)))
- (if (and (eq 'exclusive ispell-check-comments) comment-start)
- ;; search from end of current comment to start of next comment.
- (setq skip-regexp (concat (if (string= "" comment-end) "^"
- (regexp-quote comment-end))
- "\\|" skip-regexp)))
- ;; tib
- (if ispell-skip-tib
- (setq skip-regexp (concat ispell-tib-ref-beginning "\\|" skip-regexp)))
- ;; html stuff
- (if ispell-skip-html
- (setq skip-regexp (concat
- (ispell-begin-skip-region ispell-html-skip-alists)
- "\\|"
- skip-regexp)))
- ;; tex
- (if (eq ispell-parser 'tex)
- (setq skip-regexp (concat (ispell-begin-tex-skip-regexp) "\\|"
- skip-regexp)))
- ;; messages
- (if (and ispell-checking-message
- (not (eq t ispell-checking-message)))
- (setq skip-regexp (concat
- (mapconcat (lambda (lst) (car lst))
- ispell-checking-message
- "\\|")
- "\\|"
- skip-regexp)))
-
- ;; return new regexp
- skip-regexp))
+ (mapconcat
+ 'identity
+ (delq nil
+ (list
+ ;; messages
+ (if (and ispell-checking-message
+ (not (eq t ispell-checking-message)))
+ (mapconcat #'car ispell-checking-message "\\|"))
+ ;; tex
+ (if (eq ispell-parser 'tex)
+ (ispell-begin-tex-skip-regexp))
+ ;; html stuff
+ (if ispell-skip-html
+ (ispell-begin-skip-region ispell-html-skip-alists))
+ ;; tib
+ (if ispell-skip-tib ispell-tib-ref-beginning)
+ ;; Comments
+ (if (and (eq 'exclusive ispell-check-comments) comment-start)
+ ;; search from end of current comment to start of next comment.
+ (if (string= "" comment-end) "^" (regexp-quote comment-end)))
+ (if (and (null ispell-check-comments) comment-start)
+ (regexp-quote comment-start))
+ (ispell-begin-skip-region ispell-skip-region-alist)))
+ "\\|"))
(defun ispell-begin-skip-region (skip-alist)
@@ -3057,9 +3118,9 @@ Point is placed at end of skipped region."
(sit-for 2)))))
-;;; Grab the next line of data.
-;;; Returns a string with the line data
(defun ispell-get-line (start end in-comment)
+ "Grab the next line of data.
+Returns a string with the line data."
(let ((ispell-casechars (ispell-get-casechars))
string)
(cond ; LOOK AT THIS LINE AND SKIP OR PROCESS
@@ -3086,16 +3147,13 @@ Point is placed at end of skipped region."
(point) (+ (point) len))
coding)))))
-;;; Avoid error messages when compiling for these dynamic variables.
-(defvar start)
-(defvar end)
-
(defun ispell-process-line (string shift)
"Send STRING, a line of text, to ispell and processes the result.
This will modify the buffer for spelling errors.
-Requires variables START and END to be defined in its lexical scope.
+Requires variables ISPELL-START and ISPELL-END to be defined in its
+dynamic scope.
Returns the sum SHIFT due to changes in word replacements."
- ;;(declare special start end)
+ ;;(declare special ispell-start ispell-end)
(let (poss accept-list)
(if (not (numberp shift))
(setq shift 0))
@@ -3118,10 +3176,10 @@ Returns the sum SHIFT due to changes in word replacements."
;; Markers can move with highlighting! This destroys
;; end of region markers line-end and ispell-region-end
(let ((word-start
- (copy-marker (+ start ispell-offset (car (cdr poss)))))
+ (copy-marker (+ ispell-start ispell-offset (car (cdr poss)))))
(word-len (length (car poss)))
- (line-end (copy-marker end))
- (line-start (copy-marker start))
+ (line-end (copy-marker ispell-end))
+ (line-start (copy-marker ispell-start))
recheck-region replace)
(goto-char word-start)
;; Adjust the horizontal scroll & point
@@ -3221,16 +3279,19 @@ Returns the sum SHIFT due to changes in word replacements."
;; (length (car poss)))))
))
(if (not ispell-quit)
+ ;; FIXME: remove redundancy with identical code above.
(let (message-log-max)
- (message "Continuing spelling check using %s with %s dictionary..."
- (file-name-nondirectory ispell-program-name)
- (or ispell-current-dictionary "default"))))
+ (message
+ "Continuing spelling check using %s with %s dictionary..."
+ (file-name-nondirectory ispell-program-name)
+ (or ispell-current-dictionary "default"))))
(sit-for 0)
- (setq start (marker-position line-start)
- end (marker-position line-end))
+ (setq ispell-start (marker-position line-start)
+ ispell-end (marker-position line-end))
;; Adjust markers when end of region lost from highlighting.
- (if (and (not recheck-region) (< end (+ word-start word-len)))
- (setq end (+ word-start word-len)))
+ (if (and (not recheck-region)
+ (< ispell-end (+ word-start word-len)))
+ (setq ispell-end (+ word-start word-len)))
(if (= word-start ispell-region-end)
(set-marker ispell-region-end (+ word-start word-len)))
;; going out of scope - unneeded
@@ -3297,7 +3358,7 @@ Returns the sum SHIFT due to changes in word replacements."
;;; Interactive word completion.
-;;; Forces "previous-word" processing. Do we want to make this selectable?
+;; Forces "previous-word" processing. Do we want to make this selectable?
;;;###autoload
(defun ispell-complete-word (&optional interior-frag)
@@ -3319,7 +3380,8 @@ Standard ispell choices are then available."
(lookup-words (concat (and interior-frag "*") word
(if (or interior-frag (null ispell-look-p))
"*"))
- ispell-complete-word-dict)))
+ (or ispell-complete-word-dict
+ ispell-alternate-dictionary))))
(cond ((eq possibilities t)
(message "No word to complete"))
((null possibilities)
@@ -3387,15 +3449,6 @@ available on the net."
;;; Ispell Minor Mode
;;; **********************************************************************
-(defvar ispell-minor-mode nil
- "Non-nil if Ispell minor mode is enabled.")
-;; Variable indicating that ispell minor mode is active.
-(make-variable-buffer-local 'ispell-minor-mode)
-
-(or (assq 'ispell-minor-mode minor-mode-alist)
- (setq minor-mode-alist
- (cons '(ispell-minor-mode " Spell") minor-mode-alist)))
-
(defvar ispell-minor-keymap
(let ((map (make-sparse-keymap)))
(define-key map " " 'ispell-minor-check)
@@ -3403,14 +3456,8 @@ available on the net."
map)
"Keymap used for Ispell minor mode.")
-(or (not (boundp 'minor-mode-map-alist))
- (assoc 'ispell-minor-mode minor-mode-map-alist)
- (setq minor-mode-map-alist
- (cons (cons 'ispell-minor-mode ispell-minor-keymap)
- minor-mode-map-alist)))
-
;;;###autoload
-(defun ispell-minor-mode (&optional arg)
+(define-minor-mode ispell-minor-mode
"Toggle Ispell minor mode.
With prefix argument ARG, turn Ispell minor mode on if ARG is positive,
otherwise turn it off.
@@ -3420,11 +3467,7 @@ warns you if the previous word is incorrectly spelled.
All the buffer-local variables and dictionaries are ignored -- to read
them into the running ispell process, type \\[ispell-word] SPC."
- (interactive "P")
- (setq ispell-minor-mode
- (not (or (and (null arg) ispell-minor-mode)
- (<= (prefix-numeric-value arg) 0))))
- (force-mode-line-update))
+ nil " Spell" ispell-minor-keymap)
(defun ispell-minor-check ()
"Check previous word then continue with the normal binding of this key.
@@ -3690,15 +3733,14 @@ You can bind this to the key C-c i in GNUS or mail by adding to
(goto-char (point-min))
;; Select type or skip checking if this is a non-multipart message
;; Point moved to end of buffer if region is encoded.
- (if (and mimep (not boundary))
- (let (skip-regexp) ; protect from `ispell-mime-skip-part'
+ (when (and mimep (not boundary))
(goto-char (point-min))
(re-search-forward "Content-[^ \t]*:" end-of-headers t)
(forward-line -1) ; following fn starts one line above
(ispell-mime-skip-part nil)
;; if message-text-end region, limit may be less than point.
(if (> (point) limit)
- (set-marker limit (point)))))
+ (set-marker limit (point))))
(goto-char (max end-of-headers (point)))
(forward-line 1)
(setq case-fold-search old-case-fold-search)
@@ -3764,7 +3806,7 @@ Includes Latex/Nroff modes and extended character mode."
(goto-char (point-max))
;; Uses last occurrence of ispell-parsing-keyword
(if (search-backward ispell-parsing-keyword nil t)
- (let ((end (save-excursion (end-of-line) (point)))
+ (let ((end (point-at-eol))
string)
(search-forward ispell-parsing-keyword)
(while (re-search-forward " *\\([^ \"]+\\)" end t)
@@ -3781,7 +3823,7 @@ Includes Latex/Nroff modes and extended character mode."
(sit-for 2))))))))
-;;; Can kill the current ispell process
+;; Can kill the current ispell process
(defun ispell-buffer-local-dict (&optional no-reload)
"Initializes local dictionary and local personal dictionary.
@@ -3800,7 +3842,7 @@ Both should not be used to define a buffer-local dictionary."
(if (search-backward ispell-dictionary-keyword nil t)
(progn
(search-forward ispell-dictionary-keyword)
- (setq end (save-excursion (end-of-line) (point)))
+ (setq end (point-at-eol))
(if (re-search-forward " *\\([^ \"]+\\)" end t)
(setq ispell-local-dictionary
(match-string-no-properties 1))))))
@@ -3808,7 +3850,7 @@ Both should not be used to define a buffer-local dictionary."
(if (search-backward ispell-pdict-keyword nil t)
(progn
(search-forward ispell-pdict-keyword)
- (setq end (save-excursion (end-of-line) (point)))
+ (setq end (point-at-eol))
(if (re-search-forward " *\\([^ \"]+\\)" end t)
(setq ispell-local-pdict
(match-string-no-properties 1)))))))
@@ -3832,7 +3874,7 @@ Both should not be used to define a buffer-local dictionary."
(while (search-forward ispell-words-keyword nil t)
(or ispell-buffer-local-name
(setq ispell-buffer-local-name (buffer-name)))
- (let ((end (save-excursion (end-of-line) (point)))
+ (let ((end (point-at-eol))
(ispell-casechars (ispell-get-casechars))
string)
;; buffer-local words separated by a space, and can contain
@@ -3848,22 +3890,23 @@ Both should not be used to define a buffer-local dictionary."
;;; returns optionally adjusted region-end-point.
+;; If comment-padright is defined, newcomment must be loaded.
+(declare-function comment-add "newcomment" (arg))
+
(defun ispell-add-per-file-word-list (word)
"Add WORD to the per-file word list."
(or ispell-buffer-local-name
(setq ispell-buffer-local-name (buffer-name)))
(save-excursion
(goto-char (point-min))
- (let ((old-case-fold-search case-fold-search)
- line-okay search done found)
+ (let (line-okay search done found)
(while (not done)
- (setq case-fold-search nil
- search (search-forward ispell-words-keyword nil 'move)
+ (let ((case-fold-search nil))
+ (setq search (search-forward ispell-words-keyword nil 'move)
found (or found search)
line-okay (< (+ (length word) 1 ; 1 for space after word..
(progn (end-of-line) (current-column)))
- 80)
- case-fold-search old-case-fold-search)
+ fill-column)))
(if (or (and search line-okay)
(null search))
(progn
@@ -3872,8 +3915,18 @@ Both should not be used to define a buffer-local dictionary."
(progn
(open-line 1)
(unless found (newline))
- (insert (concat comment-start " " ispell-words-keyword))
- (if (> (length comment-end) 0)
+ (insert (if comment-start
+ (concat
+ (if (fboundp 'comment-padright)
+ ;; Try and use the proper comment marker,
+ ;; e.g. ";;" rather than ";".
+ (comment-padright comment-start
+ (comment-add nil))
+ comment-start)
+ " ")
+ "")
+ ispell-words-keyword)
+ (if (and comment-end (> (length comment-end) 0))
(save-excursion
(newline)
(insert comment-end)))))
@@ -3918,5 +3971,4 @@ Both should not be used to define a buffer-local dictionary."
; LocalWords: uuencoded unidiff sc nn VM SGML eval IspellPersDict unsplitable
; LocalWords: lns XEmacs HTML casechars Multibyte
-;; arch-tag: 4941b9f9-3b7c-4a76-a4ed-5fa8b6010ef5
;;; ispell.el ends here
diff --git a/lisp/textmodes/makeinfo.el b/lisp/textmodes/makeinfo.el
index 951aa7271d3..4d701a9d268 100644
--- a/lisp/textmodes/makeinfo.el
+++ b/lisp/textmodes/makeinfo.el
@@ -1,7 +1,6 @@
;;; makeinfo.el --- run makeinfo conveniently
-;; Copyright (C) 1991, 1993, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993, 2001-2011 Free Software Foundation, Inc.
;; Author: Robert J. Chassell
;; Maintainer: FSF
@@ -58,13 +57,13 @@
(defcustom makeinfo-run-command "makeinfo"
- "*Command used to run `makeinfo' subjob.
+ "Command used to run `makeinfo' subjob.
The name of the file is appended to this string, separated by a space."
:type 'string
:group 'makeinfo)
(defcustom makeinfo-options "--fill-column=70"
- "*String containing options for running `makeinfo'.
+ "String containing options for running `makeinfo'.
Do not include `--footnote-style' or `--paragraph-indent';
the proper way to specify those is with the Texinfo commands
`@footnotestyle` and `@paragraphindent'."
@@ -289,5 +288,4 @@ line LINE of the window, or centered if LINE is nil."
;;; Place `provide' at end of file.
(provide 'makeinfo)
-;; arch-tag: 5f810713-3de2-4e20-8030-4bc3dd0d9604
;;; makeinfo.el ends here
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el
index 8c2751dc0ca..8fb0bd85dab 100644
--- a/lisp/textmodes/nroff-mode.el
+++ b/lisp/textmodes/nroff-mode.el
@@ -1,7 +1,7 @@
;;; nroff-mode.el --- GNU Emacs major mode for editing nroff source
-;; Copyright (C) 1985, 1986, 1994, 1995, 1997, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1994-1995, 1997, 2001-2011
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: wp
@@ -55,6 +55,7 @@
(define-key map "\n" 'nroff-electric-newline)
(define-key map "\en" 'nroff-forward-text-line)
(define-key map "\ep" 'nroff-backward-text-line)
+ (define-key map "\C-c\C-c" 'nroff-view)
(define-key map [menu-bar nroff-mode] (cons "Nroff" menu-map))
(define-key menu-map [nn]
'(menu-item "Newline" nroff-electric-newline
@@ -73,6 +74,9 @@
nroff-electric-mode
:help "Auto insert closing requests if necessary"
:button (:toggle . nroff-electric-mode)))
+ (define-key menu-map [npm]
+ '(menu-item "Preview as man page" nroff-view
+ :help "Run man on this file."))
map)
"Major mode keymap for `nroff-mode'.")
@@ -301,6 +305,23 @@ turns it on if arg is positive, otherwise off."
:lighter " Electric"
(or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode")))
+(declare-function Man-getpage-in-background "man" (topic))
+
+(defun nroff-view ()
+ "Run man on this file."
+ (interactive)
+ (require 'man)
+ (let* ((file (buffer-file-name))
+ (viewbuf (get-buffer (concat "*Man " file "*"))))
+ (unless file
+ (error "Buffer is not associated with any file"))
+ (and (buffer-modified-p)
+ (y-or-n-p (format "Save buffer %s first? " (buffer-name)))
+ (save-buffer))
+ (if viewbuf
+ (kill-buffer viewbuf))
+ (Man-getpage-in-background file)))
+
;; Old names that were not namespace clean.
(define-obsolete-function-alias 'count-text-lines 'nroff-count-text-lines "22.1")
(define-obsolete-function-alias 'forward-text-line 'nroff-forward-text-line "22.1")
@@ -310,5 +331,4 @@ turns it on if arg is positive, otherwise off."
(provide 'nroff-mode)
-;; arch-tag: 6e276340-6c65-4f65-b4e3-0ca431ddfb6c
;;; nroff-mode.el ends here
diff --git a/lisp/textmodes/page-ext.el b/lisp/textmodes/page-ext.el
index a12a81e89b9..6e73fda662b 100644
--- a/lisp/textmodes/page-ext.el
+++ b/lisp/textmodes/page-ext.el
@@ -1,7 +1,7 @@
;;; page-ext.el --- extended page handling commands
-;; Copyright (C) 1990, 1991, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1991, 1993-1994, 2001-2011
+;; Free Software Foundation, Inc.
;; Author: Robert J. Chassell <bob@gnu.org>
;; (according to ack.texi)
@@ -242,17 +242,17 @@
(defcustom pages-directory-buffer-narrowing-p t
- "*If non-nil, `pages-directory-goto' narrows pages buffer to entry."
+ "If non-nil, `pages-directory-goto' narrows pages buffer to entry."
:type 'boolean
:group 'pages)
(defcustom pages-directory-for-adding-page-narrowing-p t
- "*If non-nil, `add-new-page' narrows page buffer to new entry."
+ "If non-nil, `add-new-page' narrows page buffer to new entry."
:type 'boolean
:group 'pages)
(defcustom pages-directory-for-adding-new-page-before-current-page-p t
- "*If non-nil, `add-new-page' inserts new page before current page."
+ "If non-nil, `add-new-page' inserts new page before current page."
:type 'boolean
:group 'pages)
@@ -260,23 +260,23 @@
;;; Addresses related variables
(defcustom pages-addresses-file-name "~/addresses"
- "*Standard name for file of addresses. Entries separated by page-delimiter.
+ "Standard name for file of addresses. Entries separated by page-delimiter.
Used by `pages-directory-for-addresses' function."
:type 'file
:group 'pages)
(defcustom pages-directory-for-addresses-goto-narrowing-p t
- "*If non-nil, `pages-directory-goto' narrows addresses buffer to entry."
+ "If non-nil, `pages-directory-goto' narrows addresses buffer to entry."
:type 'boolean
:group 'pages)
(defcustom pages-directory-for-addresses-buffer-keep-windows-p t
- "*If nil, `pages-directory-for-addresses' deletes other windows."
+ "If nil, `pages-directory-for-addresses' deletes other windows."
:type 'boolean
:group 'pages)
(defcustom pages-directory-for-adding-addresses-narrowing-p t
- "*If non-nil, `add-new-page' narrows addresses buffer to new entry."
+ "If non-nil, `add-new-page' narrows addresses buffer to new entry."
:type 'boolean
:group 'pages)
@@ -671,7 +671,7 @@ Used by `pages-directory' function."
(setq position (make-marker))
(set-marker position (point))
(let ((start (point))
- (end (save-excursion (end-of-line) (point)))
+ (end (line-end-position))
inserted-at)
;; change to directory buffer
(set-buffer standard-output)
@@ -783,7 +783,7 @@ directory."
(delete-other-windows))
(save-excursion
(goto-char (point-min))
- (delete-region (point) (save-excursion (end-of-line) (point)))
+ (delete-region (point) (line-end-position))
(insert
"=== Address List Directory: use `C-c C-c' to go to page under cursor. ===")
(set-buffer-modified-p nil)
@@ -801,5 +801,4 @@ to the same line in the pages buffer."
(provide 'page-ext)
-;; arch-tag: 2f311550-c6e0-4458-9c12-7f039c058bdb
;;; page-ext.el ends here
diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index a758a9ba998..95ba7ebd86f 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -1,10 +1,10 @@
;;; page.el --- page motion commands for Emacs
-;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: wp convenience
+;; Package: emacs
;; This file is part of GNU Emacs.
@@ -163,5 +163,4 @@ thus showing a page other than the one point was originally in."
;;; Place `provide' at end of file.
(provide 'page)
-;; arch-tag: e8d7a0bd-8655-4b6e-b852-f2ee25316a1d
;;; page.el ends here
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 95ff1327b42..a0892b5ebba 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -1,11 +1,11 @@
;;; paragraphs.el --- paragraph and sentence parsing
-;; Copyright (C) 1985, 1986, 1987, 1991, 1994, 1995, 1996, 1997, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Copyright (C) 1985-1987, 1991, 1994-1997, 1999-2011
;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: wp
+;; Package: emacs
;; This file is part of GNU Emacs.
@@ -528,5 +528,4 @@ the current sentence with the one containing the mark."
;; coding: utf-8
;; End:
-;; arch-tag: e727eb1a-527a-4464-b9d7-9d3ec0d1a575
;;; paragraphs.el ends here
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 029e75afde0..8148378cee3 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -1,7 +1,6 @@
;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model
-;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1994, 2001-2011 Free Software Foundation, Inc.
;; Author: K. Shane Hartman
;; Maintainer: FSF
@@ -34,30 +33,30 @@
(defgroup picture nil
"Picture mode --- editing using quarter-plane screen model."
:prefix "picture-"
- :group 'editing)
+ :group 'wp)
(defcustom picture-rectangle-ctl ?+
- "*Character `picture-draw-rectangle' uses for top left corners."
+ "Character `picture-draw-rectangle' uses for top left corners."
:type 'character
:group 'picture)
(defcustom picture-rectangle-ctr ?+
- "*Character `picture-draw-rectangle' uses for top right corners."
+ "Character `picture-draw-rectangle' uses for top right corners."
:type 'character
:group 'picture)
(defcustom picture-rectangle-cbr ?+
- "*Character `picture-draw-rectangle' uses for bottom right corners."
+ "Character `picture-draw-rectangle' uses for bottom right corners."
:type 'character
:group 'picture)
(defcustom picture-rectangle-cbl ?+
- "*Character `picture-draw-rectangle' uses for bottom left corners."
+ "Character `picture-draw-rectangle' uses for bottom left corners."
:type 'character
:group 'picture)
(defcustom picture-rectangle-v ?|
- "*Character `picture-draw-rectangle' uses for vertical lines."
+ "Character `picture-draw-rectangle' uses for vertical lines."
:type 'character
:group 'picture)
(defcustom picture-rectangle-h ?-
- "*Character `picture-draw-rectangle' uses for horizontal lines."
+ "Character `picture-draw-rectangle' uses for horizontal lines."
:type 'character
:group 'picture)
@@ -377,7 +376,7 @@ With positive argument insert that many lines."
;; Picture Tabs
(defcustom picture-tab-chars "!-~"
- "*A character set which controls behavior of commands.
+ "A character set which controls behavior of commands.
\\[picture-set-tab-stops] and \\[picture-tab-search]. It is NOT a
regular expression, any regexp special characters will be quoted.
It defines a set of \"interesting characters\" to look for when setting
@@ -452,7 +451,7 @@ If no such character is found, move to beginning of line."
(move-to-column target))
(if (re-search-forward
(concat "[ \t]+[" (regexp-quote picture-tab-chars) "]")
- (save-excursion (end-of-line) (point))
+ (line-end-position)
'move)
(setq target (1- (current-column)))
(setq target nil)))
@@ -789,5 +788,4 @@ Runs `picture-mode-exit-hook' at the end."
(provide 'picture)
-;; arch-tag: e452d08d-a470-4fbf-896e-ea276698d1ca
;;; picture.el ends here
diff --git a/lisp/textmodes/po.el b/lisp/textmodes/po.el
index fe3a2494589..7810cc6d57a 100644
--- a/lisp/textmodes/po.el
+++ b/lisp/textmodes/po.el
@@ -1,7 +1,6 @@
;;; po.el --- basic support of PO translation files -*- coding: latin-1; -*-
-;; Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1998, 2000-2011 Free Software Foundation, Inc.
;; Authors: Franois Pinard <pinard@iro.umontreal.ca>,
;; Greg McGary <gkm@magilla.cichlid.com>,
@@ -131,5 +130,4 @@ Called through `file-coding-system-alist', before the file is visited for real."
(provide 'po)
-;; arch-tag: 56748a57-d64c-4200-8f6b-c3a70496eb8c
;;; po.el ends here
diff --git a/lisp/textmodes/refbib.el b/lisp/textmodes/refbib.el
index 611a1de5d0a..557978395c1 100644
--- a/lisp/textmodes/refbib.el
+++ b/lisp/textmodes/refbib.el
@@ -1,7 +1,6 @@
;;; refbib.el --- convert refer-style references to ones usable by Latex bib
-;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001-2011 Free Software Foundation, Inc.
;; Author: Henry Kautz <kautz@research.att.com>
;; Maintainer: FSF
@@ -746,5 +745,4 @@ Please send bug reports and suggestions to
(provide 'refbib)
(provide 'refer-to-bibtex)
-;; arch-tag: 664afee2-6e76-4408-ba56-981d8a179586
;;; refbib.el ends here
diff --git a/lisp/textmodes/refer.el b/lisp/textmodes/refer.el
index 74823ed7172..7ee0fcf9da6 100644
--- a/lisp/textmodes/refer.el
+++ b/lisp/textmodes/refer.el
@@ -1,7 +1,6 @@
;;; refer.el --- look up references in bibliography files
-;; Copyright (C) 1992, 1996, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1996, 2001-2011 Free Software Foundation, Inc.
;; Author: Ashwin Ram <ashwin@cc.gatech.edu>
;; Maintainer: Gernot Heiser <gernot@acm.org>
@@ -96,7 +95,7 @@ happen anyway)."
:group 'refer)
(defcustom refer-bib-files 'dir
- "*List of \\.bib files to search for references,
+ "List of \\.bib files to search for references,
or one of the following special values:
nil = prompt for \\.bib file (if visiting a \\.bib file, use it as default)
auto = read \\.bib file names from appropriate command in buffer (see
@@ -115,7 +114,7 @@ each time it is needed."
:group 'refer)
(defcustom refer-cache-bib-files t
- "*Variable determining whether the value of `refer-bib-files' should be cached.
+ "Variable determining whether the value of `refer-bib-files' should be cached.
If t, initialize the value of refer-bib-files the first time it is used. If
nil, re-read the list of \\.bib files depending on the value of `refer-bib-files'
each time it is needed."
@@ -123,7 +122,7 @@ each time it is needed."
:group 'refer)
(defcustom refer-bib-files-regexp "\\\\bibliography"
- "*Regexp matching a bibliography file declaration.
+ "Regexp matching a bibliography file declaration.
The current buffer is expected to contain a line such as
\\bibliography{file1,file2,file3}
which is read to set up `refer-bib-files'. The regexp must specify the command
@@ -396,5 +395,4 @@ found on the last `refer-find-entry' or `refer-find-next-entry'."
(setq refer-bib-files files))
files))
-;; arch-tag: 151f641b-e79b-462b-9a29-a95c3793f300
;;; refer.el ends here
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index 7e4570c399c..474872955b4 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -1,7 +1,6 @@
;;; refill.el --- `auto-fill' by refilling paragraphs on changes
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2011 Free Software Foundation, Inc.
;; Author: Dave Love <fx@gnu.org>
;; Maintainer: Miles Bader <miles@gnu.org>
@@ -258,5 +257,4 @@ refilling if they would cause auto-filling."
(provide 'refill)
-;; arch-tag: 2c4ce9e8-1daa-4a3b-b6f8-fd6ac5bf6138
;;; refill.el ends here
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index 33a3e2e0d35..eba19c25ef6 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -1,11 +1,11 @@
;;; reftex-auc.el --- RefTeX's interface to AUCTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -58,7 +58,7 @@ What is being used depends upon `reftex-plug-into-AUCTeX'."
;; Create a new label, with a temporary brace for `reftex-what-macro'
(unwind-protect
(progn (insert "{") (setq label (or (reftex-label nil t) "")))
- (delete-backward-char 1)))
+ (delete-char -1)))
((and (not definition) (reftex-plug-flag 2))
;; Reference a label with RefTeX
(setq label (reftex-reference nil t)))
@@ -223,5 +223,4 @@ of ENTRY-LIST is a list of cons cells (\"MACRONAME\" . LEVEL). See
(defun reftex-notice-new-section ()
(reftex-notice-new 1 'force))
-;; arch-tag: 4a798e68-3405-421c-a09b-0269aac64ab4
;;; reftex-auc.el ends here
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index fd41d25590e..78d80da41ac 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -1,11 +1,11 @@
;;; reftex-cite.el --- creating citations with RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -357,27 +357,30 @@
(message "Scanning thebibliography environment in %s" file)
(with-current-buffer buf
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward
- "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
- (beginning-of-line 2)
- (setq start (point))
- (if (re-search-forward
- "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t)
- (progn
- (beginning-of-line 1)
- (setq end (point))))
- (when (and start end)
- (setq entries
- (append entries
- (mapcar 'reftex-parse-bibitem
- (delete ""
- (split-string
- (buffer-substring-no-properties start end)
- "[ \t\n\r]*\\\\bibitem\\(\\[[^]]*]\\)*"))))))
- (goto-char end)))))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (while (re-search-forward
+ "\\(\\`\\|[\n\r]\\)[ \t]*\\\\begin{thebibliography}" nil t)
+ (beginning-of-line 2)
+ (setq start (point))
+ (if (re-search-forward
+ "\\(\\`\\|[\n\r]\\)[ \t]*\\\\end{thebibliography}" nil t)
+ (progn
+ (beginning-of-line 1)
+ (setq end (point))))
+ (when (and start end)
+ (setq entries
+ (append entries
+ (mapcar 'reftex-parse-bibitem
+ (delete ""
+ (split-string
+ (buffer-substring-no-properties
+ start end)
+ "[ \t\n\r]*\\\\bibitem[ \t]*\
+\\(\\[[^]]*]\\)*\[ \t]*"))))))
+ (goto-char end))))))
(unless entries
(error "No bibitems found"))
@@ -1143,9 +1146,8 @@ The sequence in the new file is the same as it was in the old database."
(save-restriction
(widen)
(goto-char (point-min))
- (while (re-search-forward
- "^[ \t]*@[a-zA-Z]+[ \t]*{\\([^ \t\r\n]+\\),"
- nil t)
+ (while (re-search-forward "^[ \t]*@\\(?:\\w\\|\\s_\\)+[ \t\n\r]*\
+\[{(][ \t\n\r]*\\([^ \t\n\r,]+\\)" nil t)
(setq key (match-string 1)
beg (match-beginning 0)
end (progn
@@ -1171,5 +1173,4 @@ The sequence in the new file is the same as it was in the old database."
(length entries))))
-;; arch-tag: d53d0a5a-ab32-4b52-a846-2a7c3527cd89
;;; reftex-cite.el ends here
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index 1a0d18df699..9b924ba7ad9 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -1,11 +1,11 @@
;;; reftex-dcr.el --- viewing cross references and citations with RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -34,7 +34,7 @@
(defun reftex-view-crossref (&optional arg auto-how fail-quietly)
"View cross reference of macro at point. Point must be on the KEY
-argument. When at at `\\ref' macro, show corresponding `\\label'
+argument. When at a `\\ref' macro, show corresponding `\\label'
definition, also in external documents (`xr'). When on a label, show
a locations where KEY is referenced. Subsequent calls find additional
locations. When on a `\\cite', show the associated `\\bibitem' macro or
@@ -481,5 +481,4 @@ Calling this function several times find successive citation locations."
(move-marker reftex-global-search-marker nil)
(error "All files processed"))))
-;; arch-tag: d2f52b56-744e-44ad-830d-1fc193b90eda
;;; reftex-dcr.el ends here
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index 111d52b2ec3..ccdab49750b 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -1,11 +1,11 @@
;;; reftex-global.el --- operations on entire documents with RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -474,5 +474,4 @@ With no argument, this command toggles
(add-minor-mode 'reftex-isearch-minor-mode "/I" nil nil
'reftex-isearch-minor-mode)
-;; arch-tag: 2dbf7633-92c8-4340-8656-7aa019d0f80d
;;; reftex-global.el ends here
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 6c37667c3f6..79df6135806 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -1,11 +1,11 @@
;;; reftex-index.el --- index support with RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -274,8 +274,111 @@ will prompt for other arguments."
(and newtag (cdr cell) (not (member newtag (cdr cell)))
(push newtag (cdr cell)))))
-(defvar reftex-index-map (make-sparse-keymap)
+(defvar reftex-index-mode-map
+ (let ((map (make-sparse-keymap)))
+ ;; Index map
+ (define-key map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
+ 'reftex-index-mouse-goto-line-and-hide)
+ (define-key map [follow-link] 'mouse-face)
+
+ (substitute-key-definition
+ 'next-line 'reftex-index-next map global-map)
+ (substitute-key-definition
+ 'previous-line 'reftex-index-previous map global-map)
+
+ (loop for x in
+ '(("n" . reftex-index-next)
+ ("p" . reftex-index-previous)
+ ("?" . reftex-index-show-help)
+ (" " . reftex-index-view-entry)
+ ("\C-m" . reftex-index-goto-entry-and-hide)
+ ("\C-i" . reftex-index-goto-entry)
+ ("\C-k" . reftex-index-kill)
+ ("r" . reftex-index-rescan)
+ ("R" . reftex-index-Rescan)
+ ("g" . revert-buffer)
+ ("q" . reftex-index-quit)
+ ("k" . reftex-index-quit-and-kill)
+ ("f" . reftex-index-toggle-follow)
+ ("s" . reftex-index-switch-index-tag)
+ ("e" . reftex-index-edit)
+ ("^" . reftex-index-level-up)
+ ("_" . reftex-index-level-down)
+ ("}" . reftex-index-restrict-to-section)
+ ("{" . reftex-index-widen)
+ (">" . reftex-index-restriction-forward)
+ ("<" . reftex-index-restriction-backward)
+ ("(" . reftex-index-toggle-range-beginning)
+ (")" . reftex-index-toggle-range-end)
+ ("|" . reftex-index-edit-attribute)
+ ("@" . reftex-index-edit-visual)
+ ("*" . reftex-index-edit-key)
+ ("\C-c=". reftex-index-goto-toc)
+ ("c" . reftex-index-toggle-context))
+ do (define-key map (car x) (cdr x)))
+
+ (loop for key across "0123456789" do
+ (define-key map (vector (list key)) 'digit-argument))
+ (define-key map "-" 'negative-argument)
+
+ ;; The capital letters and the exclamation mark
+ (loop for key across (concat "!" reftex-index-section-letters) do
+ (define-key map (vector (list key))
+ (list 'lambda '() '(interactive)
+ (list 'reftex-index-goto-letter key))))
+
+ (easy-menu-define reftex-index-menu map
+ "Menu for Index buffer"
+ '("Index"
+ ["Goto section A-Z"
+ (message "To go to a section, just press any of: !%s"
+ reftex-index-section-letters) t]
+ ["Show Entry" reftex-index-view-entry t]
+ ["Go To Entry" reftex-index-goto-entry t]
+ ["Exit & Go To Entry" reftex-index-goto-entry-and-hide t]
+ ["Table of Contents" reftex-index-goto-toc t]
+ ["Quit" reftex-index-quit t]
+ "--"
+ ("Update"
+ ["Rebuilt *Index* Buffer" revert-buffer t]
+ "--"
+ ["Rescan One File" reftex-index-rescan reftex-enable-partial-scans]
+ ["Rescan Entire Document" reftex-index-Rescan t])
+ ("Restrict"
+ ["Restrict to section" reftex-index-restrict-to-section t]
+ ["Widen" reftex-index-widen reftex-index-restriction-indicator]
+ ["Next Section" reftex-index-restriction-forward
+ reftex-index-restriction-indicator]
+ ["Previous Section" reftex-index-restriction-backward
+ reftex-index-restriction-indicator])
+ ("Edit"
+ ["Edit Entry" reftex-index-edit t]
+ ["Edit Key" reftex-index-edit-key t]
+ ["Edit Attribute" reftex-index-edit-attribute t]
+ ["Edit Visual" reftex-index-edit-visual t]
+ "--"
+ ["Add Parentkey" reftex-index-level-down t]
+ ["Remove Parentkey " reftex-index-level-up t]
+ "--"
+ ["Make Start-of-Range" reftex-index-toggle-range-beginning t]
+ ["Make End-of-Range" reftex-index-toggle-range-end t]
+ "--"
+ ["Kill Entry" reftex-index-kill nil]
+ "--"
+ ["Undo" reftex-index-undo nil])
+ ("Options"
+ ["Context" reftex-index-toggle-context :style toggle
+ :selected reftex-index-include-context]
+ "--"
+ ["Follow Mode" reftex-index-toggle-follow :style toggle
+ :selected reftex-index-follow-mode])
+ "--"
+ ["Help" reftex-index-show-help t]))
+
+ map)
"Keymap used for *Index* buffers.")
+(define-obsolete-variable-alias
+ 'reftex-index-map 'reftex-index-mode-map "24.1")
(defvar reftex-index-menu)
@@ -290,19 +393,14 @@ will prompt for other arguments."
(defvar reftex-index-restriction-indicator nil)
(defvar reftex-index-restriction-data nil)
-(defun reftex-index-mode ()
+(define-derived-mode reftex-index-mode fundamental-mode "RefTeX Index"
"Major mode for managing Index buffers for LaTeX files.
This buffer was created with RefTeX.
Press `?' for a summary of important key bindings, or check the menu.
Here are all local bindings.
-\\{reftex-index-map}"
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'reftex-index-mode
- mode-name "RefTeX Index")
- (use-local-map reftex-index-map)
+\\{reftex-index-mode-map}"
(set (make-local-variable 'revert-buffer-function) 'reftex-index-revert)
(set (make-local-variable 'reftex-index-restriction-data) nil)
(set (make-local-variable 'reftex-index-restriction-indicator) nil)
@@ -317,10 +415,9 @@ Here are all local bindings.
(make-local-hook 'post-command-hook)
(make-local-hook 'pre-command-hook))
(make-local-variable 'reftex-last-follow-point)
- (easy-menu-add reftex-index-menu reftex-index-map)
+ (easy-menu-add reftex-index-menu reftex-index-mode-map)
(add-hook 'post-command-hook 'reftex-index-post-command-hook nil t)
- (add-hook 'pre-command-hook 'reftex-index-pre-command-hook nil t)
- (run-hooks 'reftex-index-mode-hook))
+ (add-hook 'pre-command-hook 'reftex-index-pre-command-hook nil t))
(defconst reftex-index-help
" AVAILABLE KEYS IN INDEX BUFFER
@@ -1031,57 +1128,6 @@ When index is restricted, select the previous section as restriction criterion."
(setq reftex-last-follow-point 1)
(and message (message "%s" message))))
-;; Index map
-(define-key reftex-index-map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
- 'reftex-index-mouse-goto-line-and-hide)
-(define-key reftex-index-map [follow-link] 'mouse-face)
-
-(substitute-key-definition
- 'next-line 'reftex-index-next reftex-index-map global-map)
-(substitute-key-definition
- 'previous-line 'reftex-index-previous reftex-index-map global-map)
-
-(loop for x in
- '(("n" . reftex-index-next)
- ("p" . reftex-index-previous)
- ("?" . reftex-index-show-help)
- (" " . reftex-index-view-entry)
- ("\C-m" . reftex-index-goto-entry-and-hide)
- ("\C-i" . reftex-index-goto-entry)
- ("\C-k" . reftex-index-kill)
- ("r" . reftex-index-rescan)
- ("R" . reftex-index-Rescan)
- ("g" . revert-buffer)
- ("q" . reftex-index-quit)
- ("k" . reftex-index-quit-and-kill)
- ("f" . reftex-index-toggle-follow)
- ("s" . reftex-index-switch-index-tag)
- ("e" . reftex-index-edit)
- ("^" . reftex-index-level-up)
- ("_" . reftex-index-level-down)
- ("}" . reftex-index-restrict-to-section)
- ("{" . reftex-index-widen)
- (">" . reftex-index-restriction-forward)
- ("<" . reftex-index-restriction-backward)
- ("(" . reftex-index-toggle-range-beginning)
- (")" . reftex-index-toggle-range-end)
- ("|" . reftex-index-edit-attribute)
- ("@" . reftex-index-edit-visual)
- ("*" . reftex-index-edit-key)
- ("\C-c=". reftex-index-goto-toc)
- ("c" . reftex-index-toggle-context))
- do (define-key reftex-index-map (car x) (cdr x)))
-
-(loop for key across "0123456789" do
- (define-key reftex-index-map (vector (list key)) 'digit-argument))
-(define-key reftex-index-map "-" 'negative-argument)
-
-;; The capital letters and the exclamation mark
-(loop for key across (concat "!" reftex-index-section-letters) do
- (define-key reftex-index-map (vector (list key))
- (list 'lambda '() '(interactive)
- (list 'reftex-index-goto-letter key))))
-
(defun reftex-index-goto-letter (char)
"Go to the CHAR section in the index."
(let ((pos (point))
@@ -1100,55 +1146,6 @@ When index is restricted, select the previous section as restriction criterion."
(error "This <%s> index does not contain entries starting with `%c'"
reftex-index-tag char)))))
-(easy-menu-define
- reftex-index-menu reftex-index-map
- "Menu for Index buffer"
- `("Index"
- ["Goto section A-Z"
- (message "To go to a section, just press any of: !%s"
- reftex-index-section-letters) t]
- ["Show Entry" reftex-index-view-entry t]
- ["Go To Entry" reftex-index-goto-entry t]
- ["Exit & Go To Entry" reftex-index-goto-entry-and-hide t]
- ["Table of Contents" reftex-index-goto-toc t]
- ["Quit" reftex-index-quit t]
- "--"
- ("Update"
- ["Rebuilt *Index* Buffer" revert-buffer t]
- "--"
- ["Rescan One File" reftex-index-rescan reftex-enable-partial-scans]
- ["Rescan Entire Document" reftex-index-Rescan t])
- ("Restrict"
- ["Restrict to section" reftex-index-restrict-to-section t]
- ["Widen" reftex-index-widen reftex-index-restriction-indicator]
- ["Next Section" reftex-index-restriction-forward
- reftex-index-restriction-indicator]
- ["Previous Section" reftex-index-restriction-backward
- reftex-index-restriction-indicator])
- ("Edit"
- ["Edit Entry" reftex-index-edit t]
- ["Edit Key" reftex-index-edit-key t]
- ["Edit Attribute" reftex-index-edit-attribute t]
- ["Edit Visual" reftex-index-edit-visual t]
- "--"
- ["Add Parentkey" reftex-index-level-down t]
- ["Remove Parentkey " reftex-index-level-up t]
- "--"
- ["Make Start-of-Range" reftex-index-toggle-range-beginning t]
- ["Make End-of-Range" reftex-index-toggle-range-end t]
- "--"
- ["Kill Entry" reftex-index-kill nil]
- "--"
- ["Undo" reftex-index-undo nil])
- ("Options"
- ["Context" reftex-index-toggle-context :style toggle
- :selected reftex-index-include-context]
- "--"
- ["Follow Mode" reftex-index-toggle-follow :style toggle
- :selected reftex-index-follow-mode])
- "--"
- ["Help" reftex-index-show-help t]))
-
;;----------------------------------------------------------------------
;; The Index Phrases File
@@ -1182,8 +1179,73 @@ This gets refreshed in every phrases command.")
"Font lock keywords for reftex-index-phrases-mode.")
(defvar reftex-index-phrases-font-lock-defaults nil
"Font lock defaults for reftex-index-phrases-mode.")
-(defvar reftex-index-phrases-map (make-sparse-keymap)
+(defvar reftex-index-phrases-mode-map
+ (let ((map (make-sparse-keymap)))
+ ;; Keybindings and Menu for phrases buffer
+ (loop for x in
+ '(("\C-c\C-c" . reftex-index-phrases-save-and-return)
+ ("\C-c\C-x" . reftex-index-this-phrase)
+ ("\C-c\C-f" . reftex-index-next-phrase)
+ ("\C-c\C-r" . reftex-index-region-phrases)
+ ("\C-c\C-a" . reftex-index-all-phrases)
+ ("\C-c\C-d" . reftex-index-remaining-phrases)
+ ("\C-c\C-s" . reftex-index-sort-phrases)
+ ("\C-c\C-n" . reftex-index-new-phrase)
+ ("\C-c\C-m" . reftex-index-phrases-set-macro-key)
+ ("\C-c\C-i" . reftex-index-phrases-info)
+ ("\C-c\C-t" . reftex-index-find-next-conflict-phrase)
+ ("\C-i" . self-insert-command))
+ do (define-key map (car x) (cdr x)))
+
+ (easy-menu-define reftex-index-phrases-menu map
+ "Menu for Phrases buffer"
+ '("Phrases"
+ ["New Phrase" reftex-index-new-phrase t]
+ ["Set Phrase Macro" reftex-index-phrases-set-macro-key t]
+ ["Recreate File Header" reftex-index-initialize-phrases-buffer t]
+ "--"
+ ("Sort Phrases"
+ ["Sort" reftex-index-sort-phrases t]
+ "--"
+ "Sort Options"
+ ["by Search Phrase" (setq reftex-index-phrases-sort-prefers-entry nil)
+ :style radio :selected (not reftex-index-phrases-sort-prefers-entry)]
+ ["by Index Entry" (setq reftex-index-phrases-sort-prefers-entry t)
+ :style radio :selected reftex-index-phrases-sort-prefers-entry]
+ ["in Blocks" (setq reftex-index-phrases-sort-in-blocks
+ (not reftex-index-phrases-sort-in-blocks))
+ :style toggle :selected reftex-index-phrases-sort-in-blocks])
+ ["Describe Phrase" reftex-index-phrases-info t]
+ ["Next Phrase Conflict" reftex-index-find-next-conflict-phrase t]
+ "--"
+ ("Find and Index in Document"
+ ["Current Phrase" reftex-index-this-phrase t]
+ ["Next Phrase" reftex-index-next-phrase t]
+ ["Current and Following" reftex-index-remaining-phrases t]
+ ["Region Phrases" reftex-index-region-phrases t]
+ ["All Phrases" reftex-index-all-phrases t]
+ "--"
+ "Options"
+ ["Match Whole Words" (setq reftex-index-phrases-search-whole-words
+ (not reftex-index-phrases-search-whole-words))
+ :style toggle :selected reftex-index-phrases-search-whole-words]
+ ["Case Sensitive Search" (setq reftex-index-phrases-case-fold-search
+ (not reftex-index-phrases-case-fold-search))
+ :style toggle :selected (not
+ reftex-index-phrases-case-fold-search)]
+ ["Wrap Long Lines" (setq reftex-index-phrases-wrap-long-lines
+ (not reftex-index-phrases-wrap-long-lines))
+ :style toggle :selected reftex-index-phrases-wrap-long-lines]
+ ["Skip Indexed Matches" (setq reftex-index-phrases-skip-indexed-matches
+ (not reftex-index-phrases-skip-indexed-matches))
+ :style toggle :selected reftex-index-phrases-skip-indexed-matches])
+ "--"
+ ["Save and Return" reftex-index-phrases-save-and-return t]))
+
+ map)
"Keymap used for *toc* buffer.")
+(define-obsolete-variable-alias
+ 'reftex-index-phrases-map 'reftex-index-phrases-mode-map "24.1")
(defun reftex-index-phrase-selection-or-word (arg)
@@ -1287,7 +1349,7 @@ If the buffer is non-empty, delete the old header first."
(defvar reftex-index-phrases-marker)
(defvar reftex-index-phrases-restrict-file nil)
;;;###autoload
-(defun reftex-index-phrases-mode ()
+(define-derived-mode reftex-index-phrases-mode fundamental-mode "Phrases"
"Major mode for managing the Index phrases of a LaTeX document.
This buffer was created with RefTeX.
@@ -1310,18 +1372,12 @@ For more information see the RefTeX User Manual.
Here are all local bindings.
-\\{reftex-index-phrases-map}"
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'reftex-index-phrases-mode
- mode-name "Phrases")
- (use-local-map reftex-index-phrases-map)
+\\{reftex-index-phrases-mode-map}"
(set (make-local-variable 'font-lock-defaults)
reftex-index-phrases-font-lock-defaults)
- (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-map)
- (set (make-local-variable 'reftex-index-phrases-marker) (make-marker))
- (run-hooks 'reftex-index-phrases-mode-hook))
-(add-hook 'reftex-index-phrases-mode-hook 'turn-on-font-lock)
+ (easy-menu-add reftex-index-phrases-menu reftex-index-phrases-mode-map)
+ (set (make-local-variable 'reftex-index-phrases-marker) (make-marker)))
+;; (add-hook 'reftex-index-phrases-mode-hook 'turn-on-font-lock)
;; Font Locking stuff
(let ((ss (if (featurep 'xemacs) 'secondary-selection ''secondary-selection)))
@@ -1698,7 +1754,7 @@ it first compares the macro identifying chars and then the phrases."
(let* ((lines (split-string (buffer-substring beg end) "\n"))
(lines1 (sort lines 'reftex-compare-phrase-lines)))
(message "Sorting lines...done")
- (let ((inhibit-quit t)) ;; make sure we do not loose lines
+ (let ((inhibit-quit t)) ;; make sure we do not lose lines
(delete-region beg end)
(insert (mapconcat 'identity lines1 "\n"))))
(goto-char (point-max))
@@ -2039,69 +2095,5 @@ Does not do a save-excursion."
reftex-index-phrases-macro-data "\n"))))
(reftex-select-with-char prompt help delay)))
-;; Keybindings and Menu for phrases buffer
-
-(loop for x in
- '(("\C-c\C-c" . reftex-index-phrases-save-and-return)
- ("\C-c\C-x" . reftex-index-this-phrase)
- ("\C-c\C-f" . reftex-index-next-phrase)
- ("\C-c\C-r" . reftex-index-region-phrases)
- ("\C-c\C-a" . reftex-index-all-phrases)
- ("\C-c\C-d" . reftex-index-remaining-phrases)
- ("\C-c\C-s" . reftex-index-sort-phrases)
- ("\C-c\C-n" . reftex-index-new-phrase)
- ("\C-c\C-m" . reftex-index-phrases-set-macro-key)
- ("\C-c\C-i" . reftex-index-phrases-info)
- ("\C-c\C-t" . reftex-index-find-next-conflict-phrase)
- ("\C-i" . self-insert-command))
- do (define-key reftex-index-phrases-map (car x) (cdr x)))
-
-(easy-menu-define
- reftex-index-phrases-menu reftex-index-phrases-map
- "Menu for Phrases buffer"
- '("Phrases"
- ["New Phrase" reftex-index-new-phrase t]
- ["Set Phrase Macro" reftex-index-phrases-set-macro-key t]
- ["Recreate File Header" reftex-index-initialize-phrases-buffer t]
- "--"
- ("Sort Phrases"
- ["Sort" reftex-index-sort-phrases t]
- "--"
- "Sort Options"
- ["by Search Phrase" (setq reftex-index-phrases-sort-prefers-entry nil)
- :style radio :selected (not reftex-index-phrases-sort-prefers-entry)]
- ["by Index Entry" (setq reftex-index-phrases-sort-prefers-entry t)
- :style radio :selected reftex-index-phrases-sort-prefers-entry]
- ["in Blocks" (setq reftex-index-phrases-sort-in-blocks
- (not reftex-index-phrases-sort-in-blocks))
- :style toggle :selected reftex-index-phrases-sort-in-blocks])
- ["Describe Phrase" reftex-index-phrases-info t]
- ["Next Phrase Conflict" reftex-index-find-next-conflict-phrase t]
- "--"
- ("Find and Index in Document"
- ["Current Phrase" reftex-index-this-phrase t]
- ["Next Phrase" reftex-index-next-phrase t]
- ["Current and Following" reftex-index-remaining-phrases t]
- ["Region Phrases" reftex-index-region-phrases t]
- ["All Phrases" reftex-index-all-phrases t]
- "--"
- "Options"
- ["Match Whole Words" (setq reftex-index-phrases-search-whole-words
- (not reftex-index-phrases-search-whole-words))
- :style toggle :selected reftex-index-phrases-search-whole-words]
- ["Case Sensitive Search" (setq reftex-index-phrases-case-fold-search
- (not reftex-index-phrases-case-fold-search))
- :style toggle :selected (not
- reftex-index-phrases-case-fold-search)]
- ["Wrap Long Lines" (setq reftex-index-phrases-wrap-long-lines
- (not reftex-index-phrases-wrap-long-lines))
- :style toggle :selected reftex-index-phrases-wrap-long-lines]
- ["Skip Indexed Matches" (setq reftex-index-phrases-skip-indexed-matches
- (not reftex-index-phrases-skip-indexed-matches))
- :style toggle :selected reftex-index-phrases-skip-indexed-matches])
- "--"
- ["Save and Return" reftex-index-phrases-save-and-return t]))
-
-
-;; arch-tag: 4b2362af-c156-42c1-8932-ea2823e205c1
+
;;; reftex-index.el ends here
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 47e1d2507e7..6ffbf7a4621 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -1,11 +1,11 @@
;;; reftex-parse.el --- parser functions for RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -384,7 +384,7 @@ of master file."
(defun reftex-section-info (file)
;; Return a section entry for the current match.
- ;; Carefull: This function expects the match-data to be still in place!
+ ;; Careful: This function expects the match-data to be still in place!
(let* ((marker (set-marker (make-marker) (1- (match-beginning 3))))
(macro (reftex-match-string 3))
(prefix (save-match-data
@@ -774,16 +774,18 @@ of master file."
pos cmd-list cmd cnt cnt-opt entry)
(save-restriction
(save-excursion
- (narrow-to-region (max 1 bound) (point-max))
+ (narrow-to-region (max (point-min) bound) (point-max))
;; move back out of the current parenthesis
(while (condition-case nil
- (progn (up-list -1) t)
+ (let ((forward-sexp-function nil))
+ (up-list -1) t)
(error nil))
(setq cnt 1 cnt-opt 0)
;; move back over any touching sexps
(while (and (reftex-move-to-previous-arg bound)
(condition-case nil
- (progn (backward-sexp) t)
+ (let ((forward-sexp-function nil))
+ (backward-sexp) t)
(error nil)))
(if (eq (following-char) ?\[) (incf cnt-opt))
(incf cnt))
@@ -964,15 +966,14 @@ of master file."
(if (re-search-forward "\\\\end{" nil t)
(match-beginning 0)
(point-max))))))
- ((or (= (preceding-char) ?\{)
- (= (preceding-char) ?\[))
+ ((memq (preceding-char) '(?\{ ?\[))
;; Inside a list - get only the list.
(buffer-substring-no-properties
(point)
(min (+ (point) 150)
(point-max)
(condition-case nil
- (progn
+ (let ((forward-sexp-function nil)) ;Unneeded fanciness.
(up-list 1)
(1- (point)))
(error (point-max))))))
@@ -1068,5 +1069,4 @@ of master file."
nrest (- nrest i))))
string))
-;; arch-tag: 6a8168f7-abb9-4576-99dc-fcbc7ba901a3
;;; reftex-parse.el ends here
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index c61a733092f..b47f2f6c2e9 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -1,11 +1,11 @@
;;; reftex-ref.el --- code to create labels and references with RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -179,8 +179,8 @@ This function is controlled by the settings of reftex-insert-label-flags."
(string-match "^[ \t]*$" default))
(setq default prefix
force-prompt t) ; need to prompt
- (setq default
- (concat prefix
+ (setq default
+ (concat prefix
(funcall reftex-string-to-label-function default)))
;; Make it unique.
@@ -226,7 +226,7 @@ This function is controlled by the settings of reftex-insert-label-flags."
((setq entry (assoc label
(symbol-value reftex-docstruct-symbol)))
(ding)
- (if (y-or-n-p
+ (if (y-or-n-p
(format "Label '%s' exists. Use anyway? " label))
(setq valid t)))
@@ -236,9 +236,9 @@ This function is controlled by the settings of reftex-insert-label-flags."
(setq label default))
;; Insert the label into the label list
- (let* ((here-I-am-info
+ (let* ((here-I-am-info
(save-excursion
- (if (and (or naked no-insert)
+ (if (and (or naked no-insert)
(integerp (cdr macro-cell)))
(goto-char (cdr macro-cell)))
(reftex-where-am-I)))
@@ -293,7 +293,7 @@ also applies `reftex-translate-to-ascii-function' to the string."
;; Translate the upper 128 chars in the Latin-1 charset to ASCII equivalents
(let ((tab "@@@@@@@@@@@@@@@@@@'@@@@@@@@@@@@@ icLxY|S\"ca<--R-o|23'uq..1o>423?AAAAAAACEEEEIIIIDNOOOOOXOUUUUYP3aaaaaaaceeeeiiiidnooooo:ouuuuypy")
(emacsp (not (featurep 'xemacs))))
- (mapconcat
+ (mapconcat
(lambda (c)
(cond ((and (> c 127) (< c 256)) ; 8 bit Latin-1
(char-to-string (aref tab (- c 128))))
@@ -429,7 +429,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
type (car type))
(setq type (reftex-query-label-type))))
- (let* ((refstyle
+ (let* ((reftex-refstyle
(cond ((reftex-typekey-check type reftex-vref-is-default) "\\vref")
((reftex-typekey-check type reftex-fref-is-default) "\\fref")
(t "\\ref")))
@@ -451,7 +451,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
(setq type (nth 1 (car labels))
form (or (cdr (assoc type reftex-typekey-to-format-alist))
form))
-
+
(cond
(no-insert
;; Just return the first label
@@ -465,7 +465,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
sep (nth 2 (car labels))
sep1 (cdr (assoc sep reftex-multiref-punctuation))
labels (cdr labels))
- (when cut
+ (when cut
(backward-delete-char cut)
(setq cut nil))
@@ -476,9 +476,9 @@ When called with 2 C-u prefix args, disable magic word recognition."
;; do we have a special format?
(setq reftex-format-ref-function
(cond
- ((string= refstyle "\\vref") 'reftex-format-vref)
- ((string= refstyle "\\fref") 'reftex-format-fref)
- ((string= refstyle "\\Fref") 'reftex-format-Fref)
+ ((string= reftex-refstyle "\\vref") 'reftex-format-vref)
+ ((string= reftex-refstyle "\\fref") 'reftex-format-fref)
+ ((string= reftex-refstyle "\\Fref") 'reftex-format-Fref)
(t reftex-format-ref-function)))
;; ok, insert the reference
(if sep1 (insert sep1))
@@ -500,7 +500,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
matched cell)
(save-excursion
(while (and (setq cell (pop words))
- (not (setq matched
+ (not (setq matched
(re-search-backward (car cell) bound t))))))
(if matched
(cons (cdr cell) (- (match-end 0) (match-end 1)))
@@ -548,7 +548,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
(setq mode-line-format
(list "---- " 'mode-line-buffer-identification
" " 'global-mode-string " (" mode-name ")"
- " S<" 'refstyle ">"
+ " S<" 'reftex-refstyle ">"
" -%-"))
(cond
((= 0 (buffer-size))
@@ -563,9 +563,9 @@ When called with 2 C-u prefix args, disable magic word recognition."
context
counter
commented
- (or here-I-am offset)
+ (or here-I-am offset)
prefix
- nil ; no a toc buffer
+ nil ; no a toc buffer
))))
(here-I-am
(setq offset (reftex-get-offset buf here-I-am typekey)))
@@ -689,13 +689,13 @@ When called with 2 C-u prefix args, disable magic word recognition."
(defun reftex-query-label-type ()
;; Ask for label type
- (let ((key (reftex-select-with-char
+ (let ((key (reftex-select-with-char
reftex-type-query-prompt reftex-type-query-help 3)))
(unless (member (char-to-string key) reftex-typekey-list)
(error "No such label type: %s" (char-to-string key)))
(char-to-string key)))
-(defun reftex-show-label-location (data forward no-revisit
+(defun reftex-show-label-location (data forward no-revisit
&optional stay error)
;; View the definition site of a label in another window.
;; DATA is an entry from the docstruct list.
@@ -717,7 +717,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
(throw 'exit nil))
;; Goto the file in another window
- (setq buffer
+ (setq buffer
(if no-revisit
(reftex-get-buffer-visiting file)
(reftex-get-file-buffer-force
@@ -783,7 +783,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
(when (or (not (eq major-mode 'latex-mode))
(not font-lock-mode))
(latex-mode)
- (run-hook-with-args
+ (run-hook-with-args
'reftex-pre-refontification-functions
reftex-call-back-to-this-buffer 'reftex-hidden)
(turn-on-font-lock))
@@ -829,8 +829,16 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window."
(reftex-access-scan-info)
(let* ((wcfg (current-window-configuration))
(docstruct (symbol-value reftex-docstruct-symbol))
- (label (completing-read "Label: " docstruct
- (lambda (x) (stringp (car x))) t))
+ ;; If point is inside a \ref{} or \pageref{}, use that as
+ ;; default value.
+ (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*")
+ (reftex-this-word "-a-zA-Z0-9_*.:")))
+ (label (completing-read (if default
+ (format "Label (default %s): " default)
+ "Label: ")
+ docstruct
+ (lambda (x) (stringp (car x))) t nil nil
+ default))
(selection (assoc label docstruct))
(where (progn
(reftex-show-label-location selection t nil 'stay)
@@ -838,10 +846,8 @@ Optional prefix argument OTHER-WINDOW goes to the label in another window."
(unless other-window
(set-window-configuration wcfg)
(switch-to-buffer (marker-buffer where))
- (goto-char where))
+ (goto-char where))
(reftex-unhighlight 0)))
-
-;; arch-tag: 52f14032-fb76-4d31-954f-750c72415675
;;; reftex-ref.el ends here
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index eec15d2cb64..b4e15fd2776 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -1,11 +1,11 @@
;;; reftex-sel.el --- the selection modes for RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -31,12 +31,81 @@
(require 'reftex)
;;;
-(defvar reftex-select-label-map nil
+;; Common bindings in reftex-select-label-mode-map
+;; and reftex-select-bib-mode-map.
+(defvar reftex-select-shared-map
+ (let ((map (make-sparse-keymap)))
+ (substitute-key-definition
+ 'next-line 'reftex-select-next map global-map)
+ (substitute-key-definition
+ 'previous-line 'reftex-select-previous map global-map)
+ (substitute-key-definition
+ 'keyboard-quit 'reftex-select-keyboard-quit map global-map)
+ (substitute-key-definition
+ 'newline 'reftex-select-accept map global-map)
+
+ (loop for x in
+ '((" " . reftex-select-callback)
+ ("n" . reftex-select-next)
+ ([(down)] . reftex-select-next)
+ ("p" . reftex-select-previous)
+ ([(up)] . reftex-select-previous)
+ ("f" . reftex-select-toggle-follow)
+ ("\C-m" . reftex-select-accept)
+ ([(return)] . reftex-select-accept)
+ ("q" . reftex-select-quit)
+ ("." . reftex-select-show-insertion-point)
+ ("?" . reftex-select-help))
+ do (define-key map (car x) (cdr x)))
+
+ ;; The mouse-2 binding
+ (if (featurep 'xemacs)
+ (define-key map [(button2)] 'reftex-select-mouse-accept)
+ (define-key map [(mouse-2)] 'reftex-select-mouse-accept)
+ (define-key map [follow-link] 'mouse-face))
+
+
+ ;; Digit arguments
+ (loop for key across "0123456789" do
+ (define-key map (vector (list key)) 'digit-argument))
+ (define-key map "-" 'negative-argument)
+ map))
+
+(defvar reftex-select-label-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map reftex-select-shared-map)
+
+ (loop for key across "aAcgFlrRstx#%" do
+ (define-key map (vector (list key))
+ (list 'lambda '()
+ "Press `?' during selection to find out about this key."
+ '(interactive) (list 'throw '(quote myexit) key))))
+
+ (loop for x in
+ '(("b" . reftex-select-jump-to-previous)
+ ("z" . reftex-select-jump)
+ ("v" . reftex-select-toggle-varioref)
+ ("V" . reftex-select-toggle-fancyref)
+ ("m" . reftex-select-mark)
+ ("u" . reftex-select-unmark)
+ ("," . reftex-select-mark-comma)
+ ("-" . reftex-select-mark-to)
+ ("+" . reftex-select-mark-and)
+ ([(tab)] . reftex-select-read-label)
+ ("\C-i" . reftex-select-read-label)
+ ("\C-c\C-n" . reftex-select-next-heading)
+ ("\C-c\C-p" . reftex-select-previous-heading))
+ do
+ (define-key map (car x) (cdr x)))
+
+ map)
"Keymap used for *RefTeX Select* buffer, when selecting a label.
This keymap can be used to configure the label selection process which is
started with the command \\[reftex-reference].")
+(define-obsolete-variable-alias
+ 'reftex-select-label-map 'reftex-select-label-mode-map "24.1")
-(defun reftex-select-label-mode ()
+(define-derived-mode reftex-select-label-mode fundamental-mode "LSelect"
"Major mode for selecting a label in a LaTeX document.
This buffer was created with RefTeX.
It only has a meaningful keymap when you are in the middle of a
@@ -46,28 +115,42 @@ Press `?' for a summary of important key bindings.
During a selection process, these are the local bindings.
-\\{reftex-select-label-map}"
-
- (interactive)
- (kill-all-local-variables)
+\\{reftex-select-label-mode-map}"
(when (featurep 'xemacs)
;; XEmacs needs the call to make-local-hook
(make-local-hook 'pre-command-hook)
(make-local-hook 'post-command-hook))
- (setq major-mode 'reftex-select-label-mode
- mode-name "LSelect")
(set (make-local-variable 'reftex-select-marked) nil)
(when (syntax-table-p reftex-latex-syntax-table)
(set-syntax-table reftex-latex-syntax-table))
;; We do not set a local map - reftex-select-item does this.
- (run-hooks 'reftex-select-label-mode-hook))
-
-(defvar reftex-select-bib-map nil
+ )
+
+(defvar reftex-select-bib-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map reftex-select-shared-map)
+
+ (loop for key across "grRaAeE" do
+ (define-key map (vector (list key))
+ (list 'lambda '()
+ "Press `?' during selection to find out about this key."
+ '(interactive) (list 'throw '(quote myexit) key))))
+
+ (loop for x in
+ '(("\C-i" . reftex-select-read-cite)
+ ([(tab)] . reftex-select-read-cite)
+ ("m" . reftex-select-mark)
+ ("u" . reftex-select-unmark))
+ do (define-key map (car x) (cdr x)))
+
+ map)
"Keymap used for *RefTeX Select* buffer, when selecting a BibTeX entry.
This keymap can be used to configure the BibTeX selection process which is
started with the command \\[reftex-citation].")
+(define-obsolete-variable-alias
+ 'reftex-select-bib-map 'reftex-select-bib-mode-map "24.1")
-(defun reftex-select-bib-mode ()
+(define-derived-mode reftex-select-bib-mode fundamental-mode "BSelect"
"Major mode for selecting a citation key in a LaTeX document.
This buffer was created with RefTeX.
It only has a meaningful keymap when you are in the middle of a
@@ -77,18 +160,14 @@ Press `?' for a summary of important key bindings.
During a selection process, these are the local bindings.
-\\{reftex-select-label-map}"
- (interactive)
- (kill-all-local-variables)
+\\{reftex-select-label-mode-map}"
(when (featurep 'xemacs)
;; XEmacs needs the call to make-local-hook
(make-local-hook 'pre-command-hook)
(make-local-hook 'post-command-hook))
- (setq major-mode 'reftex-select-bib-mode
- mode-name "BSelect")
(set (make-local-variable 'reftex-select-marked) nil)
;; We do not set a local map - reftex-select-item does this.
- (run-hooks 'reftex-select-bib-mode-hook))
+ )
;; (defun reftex-get-offset (buf here-am-I &optional typekey toc index file)
;; ;; Find the correct offset data, like insert-docstruct would, but faster.
@@ -368,22 +447,21 @@ During a selection process, these are the local bindings.
(defvar reftex-last-line nil)
(defvar reftex-select-marked nil)
-(defun reftex-select-item (prompt help-string keymap
+(defun reftex-select-item (reftex-select-prompt help-string keymap
&optional offset
call-back cb-flag)
-;; Select an item, using PROMPT. The function returns a key indicating
-;; an exit status, along with a data structure indicating which item was
-;; selected.
-;; HELP-STRING contains help. KEYMAP is a keymap with the available
-;; selection commands.
-;; OFFSET can be a label list item which will be selected at start.
-;; When it is t, point will start out at the beginning of the buffer.
-;; Any other value will cause restart where last selection left off.
-;; When CALL-BACK is given, it is a function which is called with the index
-;; of the element.
-;; CB-FLAG is the initial value of that flag.
-
- (let* (ev data last-data (selection-buffer (current-buffer)))
+ ;; Select an item, using REFTEX-SELECT-PROMPT.
+ ;; The function returns a key indicating an exit status, along with a
+ ;; data structure indicating which item was selected.
+ ;; HELP-STRING contains help. KEYMAP is a keymap with the available
+ ;; selection commands.
+ ;; OFFSET can be a label list item which will be selected at start.
+ ;; When it is t, point will start out at the beginning of the buffer.
+ ;; Any other value will cause restart where last selection left off.
+ ;; When CALL-BACK is given, it is a function which is called with the index
+ ;; of the element.
+ ;; CB-FLAG is the initial value of that flag.
+ (let (ev reftex-select-data last-data (selection-buffer (current-buffer)))
(setq reftex-select-marked nil)
@@ -403,7 +481,7 @@ During a selection process, these are the local bindings.
(use-local-map keymap)
(add-hook 'pre-command-hook 'reftex-select-pre-command-hook nil t)
(add-hook 'post-command-hook 'reftex-select-post-command-hook nil t)
- (princ prompt)
+ (princ reftex-select-prompt)
(set-marker reftex-recursive-edit-marker (point))
;; XEmacs does not run post-command-hook here
(and (featurep 'xemacs) (run-hooks 'post-command-hook))
@@ -425,19 +503,18 @@ During a selection process, these are the local bindings.
(reftex-kill-buffer "*RefTeX Help*")
(setq reftex-callback-fwd (not reftex-callback-fwd)) ;; ;-)))
(message "")
- (list ev data last-data)))
+ (list ev reftex-select-data last-data)))
;; The following variables are all bound dynamically in `reftex-select-item'.
;; The defvars are here only to silence the byte compiler.
(defvar found-list)
(defvar cb-flag)
-(defvar data)
-(defvar prompt)
+(defvar reftex-select-data)
+(defvar reftex-select-prompt)
(defvar last-data)
(defvar call-back)
(defvar help-string)
-(defvar refstyle)
;; The selection commands
@@ -447,15 +524,15 @@ During a selection process, these are the local bindings.
(defun reftex-select-post-command-hook ()
(let (b e)
- (setq data (get-text-property (point) :data))
- (setq last-data (or data last-data))
+ (setq reftex-select-data (get-text-property (point) :data))
+ (setq last-data (or reftex-select-data last-data))
- (when (and data cb-flag
+ (when (and reftex-select-data cb-flag
(not (equal reftex-last-follow-point (point))))
(setq reftex-last-follow-point (point))
- (funcall call-back data reftex-callback-fwd
+ (funcall call-back reftex-select-data reftex-callback-fwd
(not reftex-revisit-to-follow)))
- (if data
+ (if reftex-select-data
(setq b (or (previous-single-property-change
(1+ (point)) :data)
(point-min))
@@ -469,7 +546,7 @@ During a selection process, these are the local bindings.
(not (pos-visible-in-window-p e)))
(recenter '(4)))
(unless (current-message)
- (princ prompt))))
+ (princ reftex-select-prompt))))
(defun reftex-select-next (&optional arg)
"Move to next selectable item."
@@ -530,19 +607,22 @@ Useful for large TOC's."
(interactive)
(setq reftex-last-follow-point -1)
(setq cb-flag (not cb-flag)))
+
+(defvar reftex-refstyle) ; from reftex-reference
+
(defun reftex-select-toggle-varioref ()
"Toggle the macro used for referencing the label between \\ref and \\vref."
(interactive)
- (if (string= refstyle "\\ref")
- (setq refstyle "\\vref")
- (setq refstyle "\\ref"))
+ (if (string= reftex-refstyle "\\ref")
+ (setq reftex-refstyle "\\vref")
+ (setq reftex-refstyle "\\ref"))
(force-mode-line-update))
(defun reftex-select-toggle-fancyref ()
"Toggle the macro used for referencing the label between \\ref and \\vref."
(interactive)
- (setq refstyle
- (cond ((string= refstyle "\\ref") "\\fref")
- ((string= refstyle "\\fref") "\\Fref")
+ (setq reftex-refstyle
+ (cond ((string= reftex-refstyle "\\ref") "\\fref")
+ ((string= reftex-refstyle "\\fref") "\\Fref")
(t "\\ref")))
(force-mode-line-update))
(defun reftex-select-show-insertion-point ()
@@ -559,7 +639,7 @@ Useful for large TOC's."
(defun reftex-select-callback ()
"Show full context in another window."
(interactive)
- (if data (funcall call-back data reftex-callback-fwd nil) (ding)))
+ (if reftex-select-data (funcall call-back reftex-select-data reftex-callback-fwd nil) (ding)))
(defun reftex-select-accept ()
"Accept the currently selected item."
(interactive)
@@ -568,8 +648,8 @@ Useful for large TOC's."
"Accept the item at the mouse click."
(interactive "e")
(mouse-set-point ev)
- (setq data (get-text-property (point) :data))
- (setq last-data (or data last-data))
+ (setq reftex-select-data (get-text-property (point) :data))
+ (setq last-data (or reftex-select-data last-data))
(throw 'myexit 'return))
(defun reftex-select-read-label ()
"Use minibuffer to read a label to reference, with completion."
@@ -587,8 +667,8 @@ Useful for large TOC's."
(cond
((or (null key) (equal key "")))
(entry
- (setq data entry)
- (setq last-data data)
+ (setq reftex-select-data entry)
+ (setq last-data reftex-select-data)
(throw 'myexit 'return))
(t (throw 'myexit key)))))
@@ -655,85 +735,4 @@ Useful for large TOC's."
(princ help-string))
(reftex-enlarge-to-fit "*RefTeX Help*" t))
-;; Common bindings in reftex-select-label-map and reftex-select-bib-map
-(let ((map (make-sparse-keymap)))
- (substitute-key-definition
- 'next-line 'reftex-select-next map global-map)
- (substitute-key-definition
- 'previous-line 'reftex-select-previous map global-map)
- (substitute-key-definition
- 'keyboard-quit 'reftex-select-keyboard-quit map global-map)
- (substitute-key-definition
- 'newline 'reftex-select-accept map global-map)
-
- (loop for x in
- '((" " . reftex-select-callback)
- ("n" . reftex-select-next)
- ([(down)] . reftex-select-next)
- ("p" . reftex-select-previous)
- ([(up)] . reftex-select-previous)
- ("f" . reftex-select-toggle-follow)
- ("\C-m" . reftex-select-accept)
- ([(return)] . reftex-select-accept)
- ("q" . reftex-select-quit)
- ("." . reftex-select-show-insertion-point)
- ("?" . reftex-select-help))
- do (define-key map (car x) (cdr x)))
-
- ;; The mouse-2 binding
- (if (featurep 'xemacs)
- (define-key map [(button2)] 'reftex-select-mouse-accept)
- (define-key map [(mouse-2)] 'reftex-select-mouse-accept)
- (define-key map [follow-link] 'mouse-face))
-
-
- ;; Digit arguments
- (loop for key across "0123456789" do
- (define-key map (vector (list key)) 'digit-argument))
- (define-key map "-" 'negative-argument)
-
- ;; Make two maps
- (setq reftex-select-label-map map)
- (setq reftex-select-bib-map (copy-keymap map)))
-
-;; Specific bindings in reftex-select-label-map
-(loop for key across "aAcgFlrRstx#%" do
- (define-key reftex-select-label-map (vector (list key))
- (list 'lambda '()
- "Press `?' during selection to find out about this key."
- '(interactive) (list 'throw '(quote myexit) key))))
-
-(loop for x in
- '(("b" . reftex-select-jump-to-previous)
- ("z" . reftex-select-jump)
- ("v" . reftex-select-toggle-varioref)
- ("V" . reftex-select-toggle-fancyref)
- ("m" . reftex-select-mark)
- ("u" . reftex-select-unmark)
- ("," . reftex-select-mark-comma)
- ("-" . reftex-select-mark-to)
- ("+" . reftex-select-mark-and)
- ([(tab)] . reftex-select-read-label)
- ("\C-i" . reftex-select-read-label)
- ("\C-c\C-n" . reftex-select-next-heading)
- ("\C-c\C-p" . reftex-select-previous-heading))
- do
- (define-key reftex-select-label-map (car x) (cdr x)))
-
-;; Specific bindings in reftex-select-bib-map
-(loop for key across "grRaAeE" do
- (define-key reftex-select-bib-map (vector (list key))
- (list 'lambda '()
- "Press `?' during selection to find out about this key."
- '(interactive) (list 'throw '(quote myexit) key))))
-
-(loop for x in
- '(("\C-i" . reftex-select-read-cite)
- ([(tab)] . reftex-select-read-cite)
- ("m" . reftex-select-mark)
- ("u" . reftex-select-unmark))
- do (define-key reftex-select-bib-map (car x) (cdr x)))
-
-
-;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464
;;; reftex-sel.el ends here
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 1b72f6ca78d..5d691f456f7 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -1,11 +1,11 @@
;;; reftex-toc.el --- RefTeX's table of contents mode
-;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2000, 2003-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -31,8 +31,98 @@
(require 'reftex)
;;;
-(defvar reftex-toc-map (make-sparse-keymap)
+(defvar reftex-toc-mode-map
+ (let ((map (make-sparse-keymap)))
+
+ (define-key map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
+ 'reftex-toc-mouse-goto-line-and-hide)
+ (define-key map [follow-link] 'mouse-face)
+
+ (substitute-key-definition
+ 'next-line 'reftex-toc-next map global-map)
+ (substitute-key-definition
+ 'previous-line 'reftex-toc-previous map global-map)
+
+ (loop for x in
+ '(("n" . reftex-toc-next)
+ ("p" . reftex-toc-previous)
+ ("?" . reftex-toc-show-help)
+ (" " . reftex-toc-view-line)
+ ("\C-m" . reftex-toc-goto-line-and-hide)
+ ("\C-i" . reftex-toc-goto-line)
+ ("\C-c>" . reftex-toc-display-index)
+ ("r" . reftex-toc-rescan)
+ ("R" . reftex-toc-Rescan)
+ ("g" . revert-buffer)
+ ("q" . reftex-toc-quit) ;
+ ("k" . reftex-toc-quit-and-kill)
+ ("f" . reftex-toc-toggle-follow) ;
+ ("a" . reftex-toggle-auto-toc-recenter)
+ ("d" . reftex-toc-toggle-dedicated-frame)
+ ("F" . reftex-toc-toggle-file-boundary)
+ ("i" . reftex-toc-toggle-index)
+ ("l" . reftex-toc-toggle-labels)
+ ("t" . reftex-toc-max-level)
+ ("c" . reftex-toc-toggle-context)
+ ;; ("%" . reftex-toc-toggle-commented)
+ ("\M-%" . reftex-toc-rename-label)
+ ("x" . reftex-toc-external)
+ ("z" . reftex-toc-jump)
+ ("." . reftex-toc-show-calling-point)
+ ("\C-c\C-n" . reftex-toc-next-heading)
+ ("\C-c\C-p" . reftex-toc-previous-heading)
+ (">" . reftex-toc-demote)
+ ("<" . reftex-toc-promote))
+ do (define-key map (car x) (cdr x)))
+
+ (loop for key across "0123456789" do
+ (define-key map (vector (list key)) 'digit-argument))
+ (define-key map "-" 'negative-argument)
+
+ (easy-menu-define
+ reftex-toc-menu map
+ "Menu for Table of Contents buffer"
+ '("TOC"
+ ["Show Location" reftex-toc-view-line t]
+ ["Go To Location" reftex-toc-goto-line t]
+ ["Exit & Go To Location" reftex-toc-goto-line-and-hide t]
+ ["Show Calling Point" reftex-toc-show-calling-point t]
+ ["Quit" reftex-toc-quit t]
+ "--"
+ ("Edit"
+ ["Promote" reftex-toc-promote t]
+ ["Demote" reftex-toc-demote t]
+ ["Rename Label" reftex-toc-rename-label t])
+ "--"
+ ["Index" reftex-toc-display-index t]
+ ["External Document TOC " reftex-toc-external t]
+ "--"
+ ("Update"
+ ["Rebuilt *toc* Buffer" revert-buffer t]
+ ["Rescan One File" reftex-toc-rescan reftex-enable-partial-scans]
+ ["Rescan Entire Document" reftex-toc-Rescan t])
+ ("Options"
+ "TOC Items"
+ ["File Boundaries" reftex-toc-toggle-file-boundary :style toggle
+ :selected reftex-toc-include-file-boundaries]
+ ["Labels" reftex-toc-toggle-labels :style toggle
+ :selected reftex-toc-include-labels]
+ ["Index Entries" reftex-toc-toggle-index :style toggle
+ :selected reftex-toc-include-index-entries]
+ ["Context" reftex-toc-toggle-context :style toggle
+ :selected reftex-toc-include-context]
+ "--"
+ ["Follow Mode" reftex-toc-toggle-follow :style toggle
+ :selected reftex-toc-follow-mode]
+ ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
+ :selected reftex-toc-auto-recenter-timer]
+ ["Dedicated Frame" reftex-toc-toggle-dedicated-frame t])
+ "--"
+ ["Help" reftex-toc-show-help t]))
+
+ map)
"Keymap used for *toc* buffer.")
+(define-obsolete-variable-alias 'reftex-toc-map 'reftex-toc-mode-map "24.1")
(defvar reftex-toc-menu)
(defvar reftex-last-window-height nil)
@@ -41,19 +131,14 @@
(defvar reftex-toc-include-index-indicator nil)
(defvar reftex-toc-max-level-indicator nil)
-(defun reftex-toc-mode ()
+(define-derived-mode reftex-toc-mode fundamental-mode "TOC"
"Major mode for managing Table of Contents for LaTeX files.
This buffer was created with RefTeX.
Press `?' for a summary of important key bindings.
Here are all local bindings.
-\\{reftex-toc-map}"
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'reftex-toc-mode
- mode-name "TOC")
- (use-local-map reftex-toc-map)
+\\{reftex-toc-mode-map}"
(set (make-local-variable 'transient-mark-mode) t)
(when (featurep 'xemacs)
(set (make-local-variable 'zmacs-regions) t))
@@ -78,8 +163,7 @@ Here are all local bindings.
(make-local-variable 'reftex-last-follow-point)
(add-hook 'post-command-hook 'reftex-toc-post-command-hook nil t)
(add-hook 'pre-command-hook 'reftex-toc-pre-command-hook nil t)
- (easy-menu-add reftex-toc-menu reftex-toc-map)
- (run-hooks 'reftex-toc-mode-hook))
+ (easy-menu-add reftex-toc-menu reftex-toc-mode-map))
(defvar reftex-last-toc-file nil
"Stores the file name from which `reftex-toc' was called. For redo command.")
@@ -544,8 +628,6 @@ Useful for large TOC's."
;; Promotion/Demotion stuff
-(defvar delta)
-(defvar mpos)
(defvar pro-or-de)
(defvar start-pos)
(defvar start-line)
@@ -574,7 +656,7 @@ point."
(if (bolp) 1 0)))))
(start-pos (point))
(pro-or-de (if (> delta 0) "de" "pro"))
- beg end entries data sections nsec mpos msg)
+ beg end entries data sections nsec msg)
(setq msg
(catch 'exit
(if (reftex-region-active-p)
@@ -601,7 +683,9 @@ point."
(reftex-toc-extract-section-number
(nth (1- nsec) entries)))))
;; Run through the list and prepare the changes.
- (setq entries (mapcar 'reftex-toc-promote-prepare entries))
+ (setq entries (mapcar
+ (lambda (e) (reftex-toc-promote-prepare e delta))
+ entries))
;; Ask for permission
(if (or (not reftex-toc-confirm-promotion) ; never confirm
(and (integerp reftex-toc-confirm-promotion) ; confirm if many
@@ -628,31 +712,26 @@ point."
(defun reftex-toc-restore-region (point-line &optional mark-line)
- (when mark-line
- (goto-char (point-min))
- (forward-line (1- mark-line))
- (setq mpos (point)))
- (when point-line
- (goto-char (point-min))
- (forward-line (1- point-line)))
- (if mark-line
- (progn
- (set-mark mpos)
- (if (featurep 'xemacs)
- (zmacs-activate-region)
- (setq mark-active t
- deactivate-mark nil)))))
-
-(defvar name1)
-(defvar dummy)
-(defvar dummy2)
-
-(defun reftex-toc-promote-prepare (x)
+ (let (mpos)
+ (when mark-line
+ (goto-char (point-min))
+ (forward-line (1- mark-line))
+ (setq mpos (point)))
+ (when point-line
+ (goto-char (point-min))
+ (forward-line (1- point-line)))
+ (when mark-line
+ (set-mark mpos)
+ (if (featurep 'xemacs)
+ (zmacs-activate-region)
+ (setq mark-active t
+ deactivate-mark nil)))))
+
+(defun reftex-toc-promote-prepare (x delta)
"Look at a toc entry and see if we could pro/demote it.
-Expects the level change DELTA to be dynamically scoped into this function.
This function prepares everything for the changes, but does not do it.
The return value is a list with information needed when doing the
-promotion/demotion later."
+promotion/demotion later. DELTA is the level change."
(let* ((data (car x))
(toc-point (cdr x))
(marker (nth 4 data))
@@ -677,7 +756,7 @@ promotion/demotion later."
(error "Something is wrong! Contact maintainer!")))
;; Section has changed, request scan and loading
;; We use a variable to delay until after the safe-exc.
- ;; because otherwise we loose the region.
+ ;; because otherwise we lose the region.
(setq load t)))
;; Scan document and load all files, this exits command
(if load (reftex-toc-load-all-files-for-promotion))) ; exits
@@ -688,7 +767,6 @@ promotion/demotion later."
(progn
(goto-char toc-point)
(error "Cannot %smote special sections" pro-or-de))))
- ;; Delta is dynamically scoped into here...
(newlevel (if (>= level 0) (+ delta level) (- level delta)))
(dummy2 (if (or (and (>= level 0) (= newlevel -1))
(and (< level 0) (= newlevel 0)))
@@ -702,7 +780,7 @@ promotion/demotion later."
(defun reftex-toc-promote-action (x)
"Change the level of a toc entry.
-DELTA and PRO-OR-DE are assumed to be dynamically scoped into this function."
+PRO-OR-DE is assumed to be dynamically scoped into this function."
(let* ((data (car x))
(name (nth 1 x))
(newname (nth 2 x))
@@ -1011,93 +1089,4 @@ always show the current section in connection with the option
(progn
(reftex-toggle-auto-toc-recenter))))
-;; Table of Contents map
-(define-key reftex-toc-map (if (featurep 'xemacs) [(button2)] [(mouse-2)])
- 'reftex-toc-mouse-goto-line-and-hide)
-(define-key reftex-toc-map [follow-link] 'mouse-face)
-
-(substitute-key-definition
- 'next-line 'reftex-toc-next reftex-toc-map global-map)
-(substitute-key-definition
- 'previous-line 'reftex-toc-previous reftex-toc-map global-map)
-
-(loop for x in
- '(("n" . reftex-toc-next)
- ("p" . reftex-toc-previous)
- ("?" . reftex-toc-show-help)
- (" " . reftex-toc-view-line)
- ("\C-m" . reftex-toc-goto-line-and-hide)
- ("\C-i" . reftex-toc-goto-line)
- ("\C-c>" . reftex-toc-display-index)
- ("r" . reftex-toc-rescan)
- ("R" . reftex-toc-Rescan)
- ("g" . revert-buffer)
- ("q" . reftex-toc-quit);
- ("k" . reftex-toc-quit-and-kill)
- ("f" . reftex-toc-toggle-follow);
- ("a" . reftex-toggle-auto-toc-recenter)
- ("d" . reftex-toc-toggle-dedicated-frame)
- ("F" . reftex-toc-toggle-file-boundary)
- ("i" . reftex-toc-toggle-index)
- ("l" . reftex-toc-toggle-labels)
- ("t" . reftex-toc-max-level)
- ("c" . reftex-toc-toggle-context)
-; ("%" . reftex-toc-toggle-commented)
- ("\M-%" . reftex-toc-rename-label)
- ("x" . reftex-toc-external)
- ("z" . reftex-toc-jump)
- ("." . reftex-toc-show-calling-point)
- ("\C-c\C-n" . reftex-toc-next-heading)
- ("\C-c\C-p" . reftex-toc-previous-heading)
- (">" . reftex-toc-demote)
- ("<" . reftex-toc-promote))
- do (define-key reftex-toc-map (car x) (cdr x)))
-
-(loop for key across "0123456789" do
- (define-key reftex-toc-map (vector (list key)) 'digit-argument))
-(define-key reftex-toc-map "-" 'negative-argument)
-
-(easy-menu-define
- reftex-toc-menu reftex-toc-map
- "Menu for Table of Contents buffer"
- '("TOC"
- ["Show Location" reftex-toc-view-line t]
- ["Go To Location" reftex-toc-goto-line t]
- ["Exit & Go To Location" reftex-toc-goto-line-and-hide t]
- ["Show Calling Point" reftex-toc-show-calling-point t]
- ["Quit" reftex-toc-quit t]
- "--"
- ("Edit"
- ["Promote" reftex-toc-promote t]
- ["Demote" reftex-toc-demote t]
- ["Rename Label" reftex-toc-rename-label t])
- "--"
- ["Index" reftex-toc-display-index t]
- ["External Document TOC " reftex-toc-external t]
- "--"
- ("Update"
- ["Rebuilt *toc* Buffer" revert-buffer t]
- ["Rescan One File" reftex-toc-rescan reftex-enable-partial-scans]
- ["Rescan Entire Document" reftex-toc-Rescan t])
- ("Options"
- "TOC Items"
- ["File Boundaries" reftex-toc-toggle-file-boundary :style toggle
- :selected reftex-toc-include-file-boundaries]
- ["Labels" reftex-toc-toggle-labels :style toggle
- :selected reftex-toc-include-labels]
- ["Index Entries" reftex-toc-toggle-index :style toggle
- :selected reftex-toc-include-index-entries]
- ["Context" reftex-toc-toggle-context :style toggle
- :selected reftex-toc-include-context]
- "--"
- ["Follow Mode" reftex-toc-toggle-follow :style toggle
- :selected reftex-toc-follow-mode]
- ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
- :selected reftex-toc-auto-recenter-timer]
- ["Dedicated Frame" reftex-toc-toggle-dedicated-frame t])
- "--"
- ["Help" reftex-toc-show-help t]))
-
-
-;; arch-tag: 92400ce2-0b86-4c89-a606-4ed71acea17e
;;; reftex-toc.el ends here
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 6e8e4d0b804..1b503c78afd 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1,11 +1,11 @@
;;; reftex-vars.el --- configuration variables for RefTeX
-;; Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1999, 2001-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
;; Version: 4.31
+;; Package: reftex
;; This file is part of GNU Emacs.
@@ -1916,5 +1916,4 @@ construct: \\bbb [xxx] {aaa}."
(provide 'reftex-vars)
-;; arch-tag: 9591ea34-ef39-4431-90b7-c115eaf5e16f
;;; reftex-vars.el ends here
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 330c0834c76..7e150bff997 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1,6 +1,5 @@
;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX
-;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2000, 2003-2011 Free Software Foundation, Inc.
;; Author: Carsten Dominik <dominik@science.uva.nl>
;; Maintainer: auctex-devel@gnu.org
@@ -305,10 +304,6 @@
(defconst reftex-version "RefTeX version 4.31"
"Version string for RefTeX.")
-(defvar reftex-mode nil
- "Determines if RefTeX mode is active.")
-(make-variable-buffer-local 'reftex-mode)
-
(defvar reftex-mode-map (make-sparse-keymap)
"Keymap for RefTeX mode.")
@@ -504,8 +499,10 @@
"Turn on RefTeX mode."
(reftex-mode t))
+(put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode)))
+(put 'reftex-mode :menu-tag "RefTeX Mode")
;;;###autoload
-(defun reftex-mode (&optional arg)
+(define-minor-mode reftex-mode
"Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX.
\\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing
@@ -535,11 +532,7 @@ Under X, these and other functions will also be available as `Ref' menu
on the menu bar.
------------------------------------------------------------------------------"
-
- (interactive "P")
- (setq reftex-mode (not (or (and (null arg) reftex-mode)
- (<= (prefix-numeric-value arg) 0))))
-
+ :lighter " Ref" :keymap reftex-mode-map
(if reftex-mode
(progn
;; Mode was turned on
@@ -565,30 +558,16 @@ on the menu bar.
(modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
(modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
- (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib)
-
- (run-hooks 'reftex-mode-hook))
+ (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib))
;; Mode was turned off
(easy-menu-remove reftex-mode-menu)))
-(if (fboundp 'add-minor-mode)
- ;; Use it so that we get the extras
- (progn
- (put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode)))
- (put 'reftex-mode :menu-tag "RefTeX Mode")
- (add-minor-mode 'reftex-mode " Ref" reftex-mode-map))
- ;; The standard way
- (unless (assoc 'reftex-mode minor-mode-alist)
- (push '(reftex-mode " Ref") minor-mode-alist))
- (unless (assoc 'reftex-mode minor-mode-map-alist)
- (push (cons 'reftex-mode reftex-mode-map) minor-mode-map-alist)))
-
(defvar reftex-docstruct-symbol)
(defun reftex-kill-buffer-hook ()
"Save RefTeX's parse file for this buffer if the information has changed."
;; Save the parsing information if it was modified.
;; This function should be installed in `kill-buffer-hook'.
- ;; We are careful to make sure nothing goes wring in this function.
+ ;; We are careful to make sure nothing goes wrong in this function.
(when (and (boundp 'reftex-mode) reftex-mode
(boundp 'reftex-save-parse-info) reftex-save-parse-info
(boundp 'reftex-docstruct-symbol) reftex-docstruct-symbol
@@ -619,17 +598,16 @@ on the menu bar.
(defvar font-lock-mode)
(defvar font-lock-keywords)
(defvar font-lock-fontify-region-function)
-(defvar font-lock-syntactic-keywords)
;;; =========================================================================
;;;
;;; Multibuffer Variables
;;;
-;;; Technical notes: These work as follows: We keep just one list
-;;; of labels for each master file - this can save a lot of memory.
-;;; `reftex-master-index-list' is an alist which connects the true file name
-;;; of each master file with the symbols holding the information on that
-;;; document. Each buffer has local variables which point to these symbols.
+;; Technical notes: These work as follows: We keep just one list
+;; of labels for each master file - this can save a lot of memory.
+;; `reftex-master-index-list' is an alist which connects the true file name
+;; of each master file with the symbols holding the information on that
+;; document. Each buffer has local variables which point to these symbols.
;; List of variables which handle the multifile stuff.
;; This list is used to tie, untie, and reset these symbols.
@@ -2419,7 +2397,7 @@ IGNORE-WORDS List of words which should be removed from the string."
(define-key reftex-mode-map
reftex-extra-bindings-prefix
reftex-extra-bindings-map))
-
+
;;; =========================================================================
;;;
@@ -2590,7 +2568,8 @@ With optional NODE, go directly to that node."
;;; Install the kill-buffer and kill-emacs hooks ------------------------------
(add-hook 'kill-buffer-hook 'reftex-kill-buffer-hook)
-(add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook)
+(unless noninteractive
+ (add-hook 'kill-emacs-hook 'reftex-kill-emacs-hook))
;;; Run Hook ------------------------------------------------------------------
@@ -2603,5 +2582,4 @@ With optional NODE, go directly to that node."
;;;============================================================================
-;; arch-tag: 49e0da4e-bd5e-4cfc-a717-fb444fccb9e6
;;; reftex.el ends here
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 24e3764803f..1923ab692d8 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -1,7 +1,6 @@
;;; remember --- a mode for quickly jotting down things to remember
-;; Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2001, 2003-2011 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
;; Created: 29 Mar 1999
@@ -315,12 +314,6 @@ With a prefix or a visible region, use the region as INITIAL."
(let ((remember-in-new-frame t))
(remember initial)))
-(defsubst remember-time-to-seconds (time)
- "Convert TIME to a floating point number."
- (+ (* (car time) 65536.0)
- (cadr time)
- (/ (or (car (cdr (cdr time))) 0) 1000000.0)))
-
(defsubst remember-mail-date (&optional rfc822-p)
"Return a simple date. Nothing fancy."
(if rfc822-p
@@ -355,8 +348,7 @@ In which case `remember-mailbox' should be the name of the mailbox.
Each piece of pseudo-mail created will have an `X-Todo-Priority'
field, for the purpose of appropriate splitting."
(let ((who (read-string "Who is this item related to? "))
- (moment
- (format "%.0f" (remember-time-to-seconds (current-time))))
+ (moment (format "%.0f" (float-time)))
(desc (remember-buffer-desc))
(text (buffer-string)))
(with-temp-buffer
@@ -535,5 +527,4 @@ the data away for latter retrieval, and possible indexing.
\\{remember-mode-map}"
(set-keymap-parent remember-mode-map nil))
-;; arch-tag: 59312a05-06c7-4da1-b6f7-5ea41c9d5577
;;; remember.el ends here
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 4fc5d7185b3..b55146c2ff9 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -1,7 +1,6 @@
;;; rst.el --- Mode for viewing and editing reStructuredText-documents.
-;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2003-2011 Free Software Foundation, Inc.
;; Authors: Martin Blais <blais@furius.ca>,
;; Stefan Merten <smerten@oekonux.de>,
@@ -698,11 +697,9 @@ existing decoration, they are removed before adding the
requested decoration."
(interactive)
- (let (marker
- len)
-
(end-of-line)
- (setq marker (point-marker))
+ (let ((marker (point-marker))
+ len)
;; Fixup whitespace at the beginning and end of the line
(if (or (null indent) (eq style 'simple))
@@ -789,7 +786,7 @@ This function does not detect the hierarchy of decorations, it
just finds all of them in a file. You can then invoke another
function to remove redundancies and inconsistencies."
- (let (positions
+ (let ((positions ())
(curline 1))
;; Iterate over all the section titles/decorations in the file.
(save-excursion
@@ -870,7 +867,7 @@ A decoration can be said to exist if the style is not nil.
A point can be specified to go to the given location before
extracting the decoration."
- (let (char style indent)
+ (let (char style)
(save-excursion
(if point (goto-char point))
(beginning-of-line)
@@ -879,10 +876,10 @@ extracting the decoration."
(forward-line -1)
(rst-line-homogeneous-nodent-p)))
- (under (save-excursion
- (forward-line +1)
- (rst-line-homogeneous-nodent-p)))
- )
+ (under (save-excursion
+ (forward-line +1)
+ (rst-line-homogeneous-nodent-p)))
+ )
;; Check that the line above the overline is not part of a title
;; above it.
@@ -910,15 +907,11 @@ extracting the decoration."
;; Both overline and underline.
(t
(setq char under
- style 'over-and-under))
- )
- )
- )
- ;; Find indentation.
- (setq indent (save-excursion (back-to-indentation) (current-column)))
- )
- ;; Return values.
- (list char style indent)))
+ style 'over-and-under)))))
+ ;; Return values.
+ (list char style
+ ;; Find indentation.
+ (save-excursion (back-to-indentation) (current-column))))))
(defun rst-get-decorations-around (&optional alldecos)
@@ -1041,7 +1034,7 @@ b. a negative numerical argument, which generally inverts the
(interactive)
(let* (;; Save our original position on the current line.
- (origpt (set-marker (make-marker) (point)))
+ (origpt (point-marker))
;; Parse the positive and negative prefix arguments.
(reverse-direction
@@ -1395,32 +1388,28 @@ hierarchy is similar to that used by `rst-adjust-decoration'."
;; Create a list of markers for all the decorations which are found within
;; the region.
(save-excursion
- (let (m line)
+ (let (line)
(while (and cur (< (setq line (caar cur)) region-end-line))
- (setq m (make-marker))
(goto-char (point-min))
(forward-line (1- line))
- (push (list (set-marker m (point)) (cdar cur)) marker-list)
+ (push (list (point-marker) (cdar cur)) marker-list)
(setq cur (cdr cur)) ))
;; Apply modifications.
- (let (nextdeco)
- (dolist (p marker-list)
- ;; Go to the decoration to promote.
- (goto-char (car p))
-
- ;; Rotate the next decoration.
- (setq nextdeco (rst-get-next-decoration
- (cadr p) hier suggestion demote))
-
- ;; Update the decoration.
- (apply 'rst-update-section nextdeco)
-
- ;; Clear marker to avoid slowing down the editing after we're done.
- (set-marker (car p) nil)
- ))
+ (dolist (p marker-list)
+ ;; Go to the decoration to promote.
+ (goto-char (car p))
+
+ ;; Update the decoration.
+ (apply 'rst-update-section
+ ;; Rotate the next decoration.
+ (rst-get-next-decoration
+ (cadr p) hier suggestion demote))
+
+ ;; Clear marker to avoid slowing down the editing after we're done.
+ (set-marker (car p) nil))
(setq deactivate-mark nil)
- )))
+ )))
@@ -1463,11 +1452,10 @@ in order to adapt it to our preferred style."
(levels-and-markers (mapcar
(lambda (deco)
(cons (rst-position (cdr deco) hier)
- (let ((m (make-marker)))
+ (progn
(goto-char (point-min))
(forward-line (1- (car deco)))
- (set-marker m (point))
- m)))
+ (point-marker))))
alldecos))
)
(dolist (lm levels-and-markers)
@@ -1511,7 +1499,7 @@ section levels."
"Find all the positions of prefixes in region between BEG and END.
This is used to find bullets and enumerated list items. PFX-RE
is a regular expression for matching the lines with items."
- (let (pfx)
+ (let ((pfx ()))
(save-excursion
(goto-char beg)
(while (< (point) end)
@@ -1635,10 +1623,9 @@ child. This has advantages later in processing the graph."
(forward-line (1- (car deco)))
(list (gethash (cons (cadr deco) (caddr deco)) levels)
(rst-get-stripped-line)
- (let ((m (make-marker)))
+ (progn
(beginning-of-line 1)
- (set-marker m (point)))
- ))
+ (point-marker))))
alldecos)))
(let ((lcontnr (cons nil lines)))
@@ -1787,7 +1774,7 @@ The TOC is inserted indented at the current column."
(delete-region init-point (+ init-point (length initial-indent)))
;; Delete the last newline added.
- (delete-backward-char 1)
+ (delete-char -1)
)))
(defun rst-toc-insert-node (node level indent pfx)
@@ -2057,11 +2044,11 @@ brings the cursor in that section."
"In `rst-toc' mode, go to the occurrence whose line you click on.
EVENT is the input event."
(interactive "e")
- (let (pos)
+ (let ((pos
(with-current-buffer (window-buffer (posn-window (event-end event)))
(save-excursion
(goto-char (posn-point (event-end event)))
- (setq pos (rst-toc-mode-find-section))))
+ (rst-toc-mode-find-section)))))
(pop-to-buffer (marker-buffer pos))
(goto-char pos)
(recenter 5)))
@@ -2306,8 +2293,8 @@ of (COLUMN-NUMBER . LINE) pairs."
(defun rst-shift-region-guts (find-next-fun offset-fun)
"(See `rst-shift-region-right' for a description)."
- (let* ((mbeg (set-marker (make-marker) (region-beginning)))
- (mend (set-marker (make-marker) (region-end)))
+ (let* ((mbeg (copy-marker (region-beginning)))
+ (mend (copy-marker (region-end)))
(tabs (rst-compute-bullet-tabs mbeg))
(leftmostcol (rst-find-leftmost-column (region-beginning) (region-end)))
)
@@ -2386,8 +2373,8 @@ Also, if invoked with a negative prefix arg, the entire
indentation is removed, up to the leftmost character in the
region, and automatic filling is disabled."
(interactive "P")
- (let ((mbeg (set-marker (make-marker) (region-beginning)))
- (mend (set-marker (make-marker) (region-end)))
+ (let ((mbeg (copy-marker (region-beginning)))
+ (mend (copy-marker (region-end)))
(leftmostcol (rst-find-leftmost-column
(region-beginning) (region-end)))
(rst-shift-fill-region
@@ -2421,8 +2408,7 @@ Set FIRST-ONLY to true if you want to callback on the first line
of each paragraph only."
`(save-excursion
(let ((leftcol (rst-find-leftmost-column ,beg ,end))
- (endm (set-marker (make-marker) ,end))
- )
+ (endm (copy-marker ,end)))
(do* (;; Iterate lines
(l (progn (goto-char ,beg) (back-to-indentation))
@@ -2460,8 +2446,7 @@ first of a paragraph."
`(save-excursion
(let ((,leftmost (rst-find-leftmost-column ,beg ,end))
- (endm (set-marker (make-marker) ,end))
- )
+ (endm (copy-marker ,end)))
(do* (;; Iterate lines
(l (progn (goto-char ,beg) (back-to-indentation))
@@ -2538,9 +2523,7 @@ region to enumerated lists, renumbering as necessary."
(let* (;; Find items and convert the positions to markers.
(items (mapcar
(lambda (x)
- (cons (let ((m (make-marker)))
- (set-marker m (car x))
- m)
+ (cons (copy-marker (car x))
(cdr x)))
(rst-find-pfx-in-region beg end rst-re-items)))
(count 1)
@@ -2585,62 +2568,132 @@ With prefix argument set the empty lines too."
:group 'faces
:version "21.1")
-(defcustom rst-block-face 'font-lock-keyword-face
+(defface rst-block '((t :inherit font-lock-keyword-face))
+ "Face used for all syntax marking up a special block."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-block-face 'rst-block
"All syntax marking up a special block."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-block-face
+ "customize the face `rst-block' instead."
+ "24.1")
-(defcustom rst-external-face 'font-lock-type-face
+(defface rst-external '((t :inherit font-lock-type-face))
+ "Face used for field names and interpreted text."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-external-face 'rst-external
"Field names and interpreted text."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-external-face
+ "customize the face `rst-external' instead."
+ "24.1")
+
+(defface rst-definition '((t :inherit font-lock-function-name-face))
+ "Face used for all other defining constructs."
+ :version "24.1"
+ :group 'rst-faces)
-(defcustom rst-definition-face 'font-lock-function-name-face
+(defcustom rst-definition-face 'rst-definition
"All other defining constructs."
+ :version "24.1"
:group 'rst-faces
:type '(face))
-
-(defcustom rst-directive-face
- ;; XEmacs compatibility
- (if (boundp 'font-lock-builtin-face)
- 'font-lock-builtin-face
- 'font-lock-preprocessor-face)
+(make-obsolete-variable 'rst-definition-face
+ "customize the face `rst-definition' instead."
+ "24.1")
+
+;; XEmacs compatibility (?).
+(defface rst-directive (if (boundp 'font-lock-builtin-face)
+ '((t :inherit font-lock-builtin-face))
+ '((t :inherit font-lock-preprocessor-face)))
+ "Face used for directives and roles."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-directive-face 'rst-directive
"Directives and roles."
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-directive-face
+ "customize the face `rst-directive' instead."
+ "24.1")
-(defcustom rst-comment-face 'font-lock-comment-face
+(defface rst-comment '((t :inherit font-lock-comment-face))
+ "Face used for comments."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-comment-face 'rst-comment
"Comments."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-comment-face
+ "customize the face `rst-comment' instead."
+ "24.1")
+
+(defface rst-emphasis1 '((t :inherit italic))
+ "Face used for simple emphasis."
+ :version "24.1"
+ :group 'rst-faces)
-(defcustom rst-emphasis1-face
- ;; XEmacs compatibility
- (if (facep 'italic)
- ''italic
- 'italic)
+(defcustom rst-emphasis1-face 'rst-emphasis1
"Simple emphasis."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-emphasis1-face
+ "customize the face `rst-emphasis1' instead."
+ "24.1")
+
+(defface rst-emphasis2 '((t :inherit bold))
+ "Face used for double emphasis."
+ :version "24.1"
+ :group 'rst-faces)
-(defcustom rst-emphasis2-face
- ;; XEmacs compatibility
- (if (facep 'bold)
- ''bold
- 'bold)
+(defcustom rst-emphasis2-face 'rst-emphasis2
"Double emphasis."
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-emphasis2-face
+ "customize the face `rst-emphasis2' instead."
+ "24.1")
-(defcustom rst-literal-face 'font-lock-string-face
+(defface rst-literal '((t :inherit font-lock-string-face))
+ "Face used for literal text."
+ :version "24.1"
+ :group 'rst-faces)
+
+(defcustom rst-literal-face 'rst-literal
"Literal text."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-literal-face
+ "customize the face `rst-literal' instead."
+ "24.1")
+
+(defface rst-reference '((t :inherit font-lock-variable-name-face))
+ "Face used for references to a definition."
+ :version "24.1"
+ :group 'rst-faces)
-(defcustom rst-reference-face 'font-lock-variable-name-face
+(defcustom rst-reference-face 'rst-reference
"References to a definition."
+ :version "24.1"
:group 'rst-faces
:type '(face))
+(make-obsolete-variable 'rst-reference-face
+ "customize the face `rst-reference' instead."
+ "24.1")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2789,10 +2842,7 @@ details check the Rst Faces Defaults group."
;; There seems to be a bug leading to error "Stack overflow in regexp
;; matcher" when "|" or "\\*" are the characters searched for
- (re-imendbeg
- (if (< emacs-major-version 21)
- "]"
- "\\]\\|\\\\."))
+ (re-imendbeg "\\]\\|\\\\.")
;; inline markup content end
(re-imend (concat re-imendbeg "\\)*[^\t \\\\]\\)"))
;; inline markup content without asterisk
@@ -2818,94 +2868,76 @@ details check the Rst Faces Defaults group."
;; Simple `Body Elements`_
;; `Bullet Lists`_
- (list
- (concat re-bol "\\([-*+]" re-blksep1 "\\)")
- 1 rst-block-face)
+ `(,(concat re-bol "\\([-*+]" re-blksep1 "\\)")
+ 1 rst-block-face)
;; `Enumerated Lists`_
- (list
- (concat re-bol "\\((?\\(#\\|[0-9]+\\|[A-Za-z]\\|[IVXLCMivxlcm]+\\)[.)]"
- re-blksep1 "\\)")
- 1 rst-block-face)
+ `(,(concat re-bol "\\((?\\(#\\|[0-9]+\\|[A-Za-z]\\|[IVXLCMivxlcm]+\\)[.)]"
+ re-blksep1 "\\)")
+ 1 rst-block-face)
;; `Definition Lists`_ FIXME: missing
;; `Field Lists`_
- (list
- (concat re-bol "\\(:[^:\n]+:\\)" re-blksep1)
- 1 rst-external-face)
+ `(,(concat re-bol "\\(:[^:\n]+:\\)" re-blksep1)
+ 1 rst-external-face)
;; `Option Lists`_
- (list
- (concat re-bol "\\(\\(\\(\\([-+/]\\|--\\)\\sw\\(-\\|\\sw\\)*"
- "\\([ =]\\S +\\)?\\)\\(,[\t ]\\)?\\)+\\)\\($\\|[\t ]\\{2\\}\\)")
- 1 rst-block-face)
+ `(,(concat re-bol "\\(\\(\\(\\([-+/]\\|--\\)\\sw\\(-\\|\\sw\\)*"
+ "\\([ =]\\S +\\)?\\)\\(,[\t ]\\)?\\)+\\)\\($\\|[\t ]\\{2\\}\\)")
+ 1 rst-block-face)
;; `Tables`_ FIXME: missing
;; All the `Explicit Markup Blocks`_
;; `Footnotes`_ / `Citations`_
- (list
- (concat re-bol "\\(" re-ems "\\[[^[\n]+\\]\\)" re-blksep1)
+ `(,(concat re-bol "\\(" re-ems "\\[[^[\n]+\\]\\)" re-blksep1)
1 rst-definition-face)
;; `Directives`_ / `Substitution Definitions`_
- (list
- (concat re-bol "\\(" re-ems "\\)\\(\\(|[^|\n]+|[\t ]+\\)?\\)\\("
- re-sym1 "+::\\)" re-blksep1)
- (list 1 rst-directive-face)
- (list 2 rst-definition-face)
- (list 4 rst-directive-face))
+ `(,(concat re-bol "\\(" re-ems "\\)\\(\\(|[^|\n]+|[\t ]+\\)?\\)\\("
+ re-sym1 "+::\\)" re-blksep1)
+ (1 rst-directive-face)
+ (2 rst-definition-face)
+ (4 rst-directive-face))
;; `Hyperlink Targets`_
- (list
- (concat re-bol "\\(" re-ems "_\\([^:\\`\n]\\|\\\\.\\|`[^`\n]+`\\)+:\\)"
- re-blksep1)
- 1 rst-definition-face)
- (list
- (concat re-bol "\\(__\\)" re-blksep1)
- 1 rst-definition-face)
+ `(,(concat re-bol "\\(" re-ems "_\\([^:\\`\n]\\|\\\\.\\|`[^`\n]+`\\)+:\\)"
+ re-blksep1)
+ 1 rst-definition-face)
+ `(,(concat re-bol "\\(__\\)" re-blksep1)
+ 1 rst-definition-face)
;; All `Inline Markup`_
;; FIXME: Condition 5 preventing fontification of e.g. "*" not implemented
;; `Strong Emphasis`_
- (list
- (concat re-imp1 "\\(\\*\\*" re-ima2 "\\*\\*\\)" re-ims1)
- 2 rst-emphasis2-face)
+ `(,(concat re-imp1 "\\(\\*\\*" re-ima2 "\\*\\*\\)" re-ims1)
+ 2 rst-emphasis2-face)
;; `Emphasis`_
- (list
- (concat re-imp1 "\\(\\*" re-ima2 "\\*\\)" re-ims1)
- 2 rst-emphasis1-face)
+ `(,(concat re-imp1 "\\(\\*" re-ima2 "\\*\\)" re-ims1)
+ 2 rst-emphasis1-face)
;; `Inline Literals`_
- (list
- (concat re-imp1 "\\(``" re-imb2 "``\\)" re-ims1)
- 2 rst-literal-face)
+ `(,(concat re-imp1 "\\(``" re-imb2 "``\\)" re-ims1)
+ 2 rst-literal-face)
;; `Inline Internal Targets`_
- (list
- (concat re-imp1 "\\(_`" re-imb2 "`\\)" re-ims1)
- 2 rst-definition-face)
+ `(,(concat re-imp1 "\\(_`" re-imb2 "`\\)" re-ims1)
+ 2 rst-definition-face)
;; `Hyperlink References`_
;; FIXME: `Embedded URIs`_ not considered
- (list
- (concat re-imp1 "\\(\\(`" re-imb2 "`\\|\\(\\sw\\(\\sw\\|-\\)+\\sw\\)\\)__?\\)" re-ims1)
+ `(,(concat re-imp1 "\\(\\(`" re-imb2 "`\\|\\(\\sw\\(\\sw\\|-\\)+\\sw\\)\\)__?\\)" re-ims1)
2 rst-reference-face)
;; `Interpreted Text`_
- (list
- (concat re-imp1 "\\(\\(:" re-sym1 "+:\\)?\\)\\(`" re-imb2 "`\\)\\(\\(:"
- re-sym1 "+:\\)?\\)" re-ims1)
- (list 2 rst-directive-face)
- (list 5 rst-external-face)
- (list 8 rst-directive-face))
+ `(,(concat re-imp1 "\\(\\(:" re-sym1 "+:\\)?\\)\\(`" re-imb2 "`\\)\\(\\(:"
+ re-sym1 "+:\\)?\\)" re-ims1)
+ (2 rst-directive-face)
+ (5 rst-external-face)
+ (8 rst-directive-face))
;; `Footnote References`_ / `Citation References`_
- (list
- (concat re-imp1 "\\(\\[[^]]+\\]_\\)" re-ims1)
- 2 rst-reference-face)
+ `(,(concat re-imp1 "\\(\\[[^]]+\\]_\\)" re-ims1)
+ 2 rst-reference-face)
;; `Substitution References`_
- (list
- (concat re-imp1 "\\(|" re-imv2 "|\\)" re-ims1)
- 2 rst-reference-face)
+ `(,(concat re-imp1 "\\(|" re-imv2 "|\\)" re-ims1)
+ 2 rst-reference-face)
;; `Standalone Hyperlinks`_
- (list
- ;; FIXME: This takes it easy by using a whitespace as delimiter
- (concat re-imp1 "\\(" re-uris1 ":\\S +\\)" re-ims1)
- 2 rst-definition-face)
- (list
- (concat re-imp1 "\\(" re-sym1 "+@" re-sym1 "+\\)" re-ims1)
- 2 rst-definition-face)
+ `(;; FIXME: This takes it easy by using a whitespace as delimiter
+ ,(concat re-imp1 "\\(" re-uris1 ":\\S +\\)" re-ims1)
+ 2 rst-definition-face)
+ `(,(concat re-imp1 "\\(" re-sym1 "+@" re-sym1 "+\\)" re-ims1)
+ 2 rst-definition-face)
;; Do all block fontification as late as possible so 'append works
@@ -2914,7 +2946,7 @@ details check the Rst Faces Defaults group."
(list
re-ado2)
(if (not rst-mode-lazy)
- (list 1 rst-block-face)
+ '(1 rst-block-face)
(list
(list 'rst-font-lock-handle-adornment
'(progn
@@ -2934,7 +2966,7 @@ details check the Rst Faces Defaults group."
(list
(concat re-bol "\\(" re-ems "\\)\[^[|_]\\([^:\n]\\|:\\([^:\n]\\|$\\)\\)*$")
- (list 1 rst-comment-face))
+ '(1 rst-comment-face))
(if rst-mode-lazy
(list
(list 'rst-font-lock-find-unindented-line
@@ -2942,12 +2974,12 @@ details check the Rst Faces Defaults group."
(setq rst-font-lock-indentation-point (match-end 1))
(point-max))
nil
- (list 0 rst-comment-face 'append)))))
+ '(0 rst-comment-face append)))))
(append
(list
(concat re-bol "\\(" re-emt "\\)\\(\\s *\\)$")
- (list 1 rst-comment-face)
- (list 2 rst-comment-face))
+ '(1 rst-comment-face)
+ '(2 rst-comment-face))
(if rst-mode-lazy
(list
(list 'rst-font-lock-find-unindented-line
@@ -2955,13 +2987,13 @@ details check the Rst Faces Defaults group."
(setq rst-font-lock-indentation-point 'next)
(point-max))
nil
- (list 0 rst-comment-face 'append)))))
+ '(0 rst-comment-face append)))))
;; `Literal Blocks`_
(append
(list
(concat re-bol "\\(\\([^.\n]\\|\\.[^.\n]\\).*\\)?\\(::\\)$")
- (list 3 rst-block-face))
+ '(3 rst-block-face))
(if rst-mode-lazy
(list
(list 'rst-font-lock-find-unindented-line
@@ -2969,14 +3001,14 @@ details check the Rst Faces Defaults group."
(setq rst-font-lock-indentation-point t)
(point-max))
nil
- (list 0 rst-literal-face 'append)))))
+ '(0 rst-literal-face append)))))
;; `Doctest Blocks`_
(append
(list
(concat re-bol "\\(>>>\\|\\.\\.\\.\\)\\(.+\\)")
- (list 1 rst-block-face)
- (list 2 rst-literal-face)))
+ '(1 rst-block-face)
+ '(2 rst-literal-face)))
)))
@@ -3201,16 +3233,37 @@ document with \\[rst-compile]."
:group 'rst
:version "21.1")
-(defvar rst-compile-toolsets
- '((html . ("rst2html.py" ".html" nil))
- (latex . ("rst2latex.py" ".tex" nil))
- (newlatex . ("rst2newlatex.py" ".tex" nil))
- (pseudoxml . ("rst2pseudoxml.py" ".xml" nil))
- (xml . ("rst2xml.py" ".xml" nil)))
+(defcustom rst-compile-toolsets
+ `((html ,(if (executable-find "rst2html.py") "rst2html.py" "rst2html")
+ ".html" nil)
+ (latex ,(if (executable-find "rst2latex.py") "rst2latex.py" "rst2latex")
+ ".tex" nil)
+ (newlatex ,(if (executable-find "rst2newlatex.py") "rst2newlatex.py"
+ "rst2newlatex")
+ ".tex" nil)
+ (pseudoxml ,(if (executable-find "rst2pseudoxml.py") "rst2pseudoxml.py"
+ "rst2pseudoxml")
+ ".xml" nil)
+ (xml ,(if (executable-find "rst2xml.py") "rst2xml.py" "rst2xml")
+ ".xml" nil)
+ (pdf ,(if (executable-find "rst2pdf.py") "rst2pdf.py" "rst2pdf")
+ ".pdf" nil)
+ (s5 ,(if (executable-find "rst2s5.py") "rst2s5.py" "rst2s5")
+ ".html" nil))
"Table describing the command to use for each toolset.
An association list of the toolset to a list of the (command to use,
extension of produced filename, options to the tool (nil or a
-string)) to be used for converting the document.")
+string)) to be used for converting the document."
+ :type '(alist :options (html latex newlatex pseudoxml xml pdf s5)
+ :key-type symbol
+ :value-type (list :tag "Specification"
+ (file :tag "Command")
+ (string :tag "File extension")
+ (choice :tag "Command options"
+ (const :tag "No options" nil)
+ (string :tag "Options"))))
+ :group 'rst
+ :version "24.1")
;; Note for Python programmers not familiar with association lists: you can set
;; values in an alists like this, e.g. :
@@ -3298,7 +3351,7 @@ or of the entire buffer, if the region is not selected."
(shell-command-on-region
(if mark-active (region-beginning) (point-min))
(if mark-active (region-end) (point-max))
- "rst2pseudoxml.py"
+ (cadr (assq 'pseudoxml rst-compile-toolsets))
standard-output)))
(defvar rst-pdf-program "xpdf"
@@ -3308,7 +3361,8 @@ or of the entire buffer, if the region is not selected."
"Convert the document to a PDF file and launch a preview program."
(interactive)
(let* ((tmp-filename (make-temp-file "rst-out" nil ".pdf"))
- (command (format "rst2pdf.py %s %s && %s %s"
+ (command (format "%s %s %s && %s %s"
+ (cadr (assq 'pdf rst-compile-toolsets))
buffer-file-name tmp-filename
rst-pdf-program tmp-filename)))
(start-process-shell-command "rst-pdf-preview" nil command)
@@ -3323,7 +3377,8 @@ or of the entire buffer, if the region is not selected."
"Convert the document to an S5 slide presentation and launch a preview program."
(interactive)
(let* ((tmp-filename (make-temp-file "rst-slides" nil ".html"))
- (command (format "rst2s5.py %s %s && %s %s"
+ (command (format "%s %s %s && %s %s"
+ (cadr (assq 's5 rst-compile-toolsets))
buffer-file-name tmp-filename
rst-slides-program tmp-filename)))
(start-process-shell-command "rst-slides-preview" nil command)
@@ -3421,11 +3476,10 @@ column is used (fill-column vs. end of previous/next line)."
"A portable function that returns non-nil if the mark is active."
(cond
((fboundp 'region-active-p) (region-active-p))
- ((boundp 'transient-mark-mode) transient-mark-mode mark-active)))
-
+ ((boundp 'transient-mark-mode) (and transient-mark-mode mark-active))
+ (t mark-active)))
(provide 'rst)
-;; arch-tag: 255ac0a3-a689-44cb-8643-04ca55ae490d
;;; rst.el ends here
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 2338c47d454..314fbf9671b 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1,7 +1,7 @@
;;; sgml-mode.el --- SGML- and HTML-editing modes -*- coding: utf-8 -*-
-;; Copyright (C) 1992, 1995, 1996, 1998, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1995-1996, 1998, 2001-2011
+;; Free Software Foundation, Inc.
;; Author: James Clark <jjc@jclark.com>
;; Maintainer: FSF
@@ -100,7 +100,13 @@ This takes effect when first loading the `sgml-mode' library.")
(define-key map "\C-c\C-d" 'sgml-delete-tag)
(define-key map "\C-c\^?" 'sgml-delete-tag)
(define-key map "\C-c?" 'sgml-tag-help)
+ (define-key map "\C-c]" 'sgml-close-tag)
(define-key map "\C-c/" 'sgml-close-tag)
+
+ ;; Redundant keybindings, for consistency with TeX mode.
+ (define-key map "\C-c\C-o" 'sgml-tag)
+ (define-key map "\C-c\C-e" 'sgml-close-tag)
+
(define-key map "\C-c8" 'sgml-name-8bit-mode)
(define-key map "\C-c\C-v" 'sgml-validate)
(when sgml-quick-keys
@@ -288,11 +294,12 @@ Any terminating `>' or `/' is not matched.")
(defvar sgml-font-lock-keywords sgml-font-lock-keywords-1
"*Rules for highlighting SGML code. See also `sgml-tag-face-alist'.")
-(defvar sgml-font-lock-syntactic-keywords
+(defconst sgml-syntax-propertize-function
+ (syntax-propertize-rules
;; Use the `b' style of comments to avoid interference with the -- ... --
;; comments recognized when `sgml-specials' includes ?-.
;; FIXME: beware of <!--> blabla <!--> !!
- '(("\\(<\\)!--" (1 "< b"))
+ ("\\(<\\)!--" (1 "< b"))
("--[ \t\n]*\\(>\\)" (1 "> b"))
;; Double quotes outside of tags should not introduce strings.
;; Be careful to call `syntax-ppss' on a position before the one we're
@@ -377,6 +384,9 @@ a DOCTYPE or an XML declaration."
(save-excursion
(goto-char (point-min))
(or (string= "xml" (file-name-extension (or buffer-file-name "")))
+ ;; Maybe the buffer-size check isn't needed, I don't know.
+ (and (zerop (buffer-size))
+ (string= "xhtml" (file-name-extension (or buffer-file-name ""))))
(looking-at "\\s-*<\\?xml")
(when (re-search-forward
(eval-when-compile
@@ -417,7 +427,12 @@ a DOCTYPE or an XML declaration."
(format-mode-line mode-name))))))
(defun sgml-fill-nobreak ()
- ;; Don't break between a tag name and its first argument.
+ "Don't break between a tag name and its first argument.
+This function is designed for use in `fill-nobreak-predicate'.
+
+ <a href=\"some://where\" type=\"text/plain\">
+ ^ ^
+ | no break here | but still allowed here"
(save-excursion
(skip-chars-backward " \t")
(and (not (zerop (skip-syntax-backward "w_")))
@@ -472,9 +487,9 @@ Do \\[describe-key] on the following bindings to discover what they do.
'((sgml-font-lock-keywords
sgml-font-lock-keywords-1
sgml-font-lock-keywords-2)
- nil t nil nil
- (font-lock-syntactic-keywords
- . sgml-font-lock-syntactic-keywords)))
+ nil t))
+ (set (make-local-variable 'syntax-propertize-function)
+ sgml-syntax-propertize-function)
(set (make-local-variable 'facemenu-add-face-function)
'sgml-mode-facemenu-add-face-function)
(set (make-local-variable 'sgml-xml-mode) (sgml-xml-guess))
@@ -521,7 +536,7 @@ Behaves electrically if `sgml-quick-keys' is non-nil."
(insert-char ?/ 1)
(indent-according-to-mode))
((eq sgml-quick-keys 'close)
- (delete-backward-char 1)
+ (delete-char -1)
(sgml-close-tag))
(t
(sgml-slash-matching arg))))
@@ -578,7 +593,7 @@ encoded keyboard operation."
(insert ?&)
(or char
(setq char (read-quoted-char "Enter char or octal number")))
- (delete-backward-char 1)
+ (delete-char -1)
(insert char)
(undo-boundary)
(sgml-namify-char))
@@ -596,7 +611,7 @@ Uses `sgml-char-names'."
((encode-char char 'ucs)))))
(if (not name)
(error "Don't know the name of `%c'" char)
- (delete-backward-char 1)
+ (delete-char -1)
(insert (format (if (numberp name) "&#%d;" "&%s;") name)))))
(defun sgml-name-self ()
@@ -702,7 +717,7 @@ If QUIET, do not print a message when there are no attributes for TAG."
(sgml-value (assoc (downcase attribute) alist))
(setq i (1- i))))
(if (eq (preceding-char) ?\s)
- (delete-backward-char 1)))
+ (delete-char -1)))
car)))
(defun sgml-auto-attributes (arg)
@@ -1112,7 +1127,7 @@ See `sgml-tag-alist' for info about attribute rules."
(setq alist (skeleton-read '(completing-read "Value: " (cdr alist))))
(if (string< "" alist)
(insert alist ?\")
- (delete-backward-char 2)))
+ (delete-char -2)))
(insert "=\"")
(if (cdr alist)
(insert (skeleton-read '(completing-read "Value: " alist)))
@@ -2146,5 +2161,4 @@ Can be used as a value for `html-mode-hook'."
(provide 'sgml-mode)
-;; arch-tag: 9675da94-b7f9-4bda-ad19-73ed7b4fb401
;;; sgml-mode.el ends here
diff --git a/lisp/textmodes/spell.el b/lisp/textmodes/spell.el
deleted file mode 100644
index bccd4a5646c..00000000000
--- a/lisp/textmodes/spell.el
+++ /dev/null
@@ -1,172 +0,0 @@
-;;; spell.el --- spelling correction interface for Emacs
-
-;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-
-;; Maintainer: FSF
-;; Keywords: wp, unix
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This mode provides an Emacs interface to the UNIX spell(1) program.
-;; Entry points are `spell-buffer', `spell-word', `spell-region' and
-;; `spell-string'.
-
-;; See also ispell.el for an interface to the ispell program.
-
-;;; Code:
-
-(defgroup spell nil
- "Interface to the UNIX spell(1) program."
- :prefix "spell-"
- :group 'applications)
-
-(defcustom spell-command "spell"
- "*Command to run the spell program."
- :type 'string
- :group 'spell)
-
-(defcustom spell-filter nil
- "*Filter function to process text before passing it to spell program.
-This function might remove text-processor commands.
-nil means don't alter the text before checking it."
- :type '(choice (const nil) function)
- :group 'spell)
-
-;;;###autoload
-(put 'spell-filter 'risky-local-variable t)
-
-;;;###autoload
-(defun spell-buffer ()
- "Check spelling of every word in the buffer.
-For each incorrect word, you are asked for the correct spelling
-and then put into a query-replace to fix some or all occurrences.
-If you do not want to change a word, just give the same word
-as its \"correct\" spelling; then the query replace is skipped."
- (interactive)
- ;; Don't warn about spell-region being obsolete.
- (with-no-warnings
- (spell-region (point-min) (point-max) "buffer")))
-;;;###autoload
-(make-obsolete 'spell-buffer 'ispell-buffer "23.1")
-
-;;;###autoload
-(defun spell-word ()
- "Check spelling of word at or before point.
-If it is not correct, ask user for the correct spelling
-and `query-replace' the entire buffer to substitute it."
- (interactive)
- (let (beg end spell-filter)
- (save-excursion
- (if (not (looking-at "\\<"))
- (forward-word -1))
- (setq beg (point))
- (forward-word 1)
- (setq end (point)))
- ;; Don't warn about spell-region being obsolete.
- (with-no-warnings
- (spell-region beg end (buffer-substring beg end)))))
-;;;###autoload
-(make-obsolete 'spell-word 'ispell-word "23.1")
-
-;;;###autoload
-(defun spell-region (start end &optional description)
- "Like `spell-buffer' but applies only to region.
-Used in a program, applies from START to END.
-DESCRIPTION is an optional string naming the unit being checked:
-for example, \"word\"."
- (interactive "r")
- (let ((filter spell-filter)
- (buf (get-buffer-create " *temp*")))
- (with-current-buffer buf
- (widen)
- (erase-buffer))
- (message "Checking spelling of %s..." (or description "region"))
- (if (and (null filter) (= ?\n (char-after (1- end))))
- (if (string= "spell" spell-command)
- (call-process-region start end "spell" nil buf)
- (call-process-region start end shell-file-name
- nil buf nil "-c" spell-command))
- (let ((oldbuf (current-buffer)))
- (with-current-buffer buf
- (insert-buffer-substring oldbuf start end)
- (or (bolp) (insert ?\n))
- (if filter (funcall filter))
- (if (string= "spell" spell-command)
- (call-process-region (point-min) (point-max) "spell" t buf)
- (call-process-region (point-min) (point-max) shell-file-name
- t buf nil "-c" spell-command)))))
- (message "Checking spelling of %s...%s"
- (or description "region")
- (if (with-current-buffer buf
- (> (buffer-size) 0))
- "not correct"
- "correct"))
- (let (word newword
- (case-fold-search t)
- (case-replace t))
- (while (with-current-buffer buf
- (> (buffer-size) 0))
- (with-current-buffer buf
- (goto-char (point-min))
- (setq word (downcase
- (buffer-substring (point)
- (progn (end-of-line) (point)))))
- (forward-char 1)
- (delete-region (point-min) (point))
- (setq newword
- (read-string (concat "`" word
- "' not recognized; edit a replacement: ")
- word))
- (flush-lines (concat "^" (regexp-quote word) "$")))
- (if (not (equal word newword))
- (progn
- (goto-char (point-min))
- (query-replace-regexp (concat "\\b" (regexp-quote word) "\\b")
- newword)))))))
-;;;###autoload
-(make-obsolete 'spell-region 'ispell-region "23.1")
-
-;;;###autoload
-(defun spell-string (string)
- "Check spelling of string supplied as argument."
- (interactive "sSpell string: ")
- (let ((buf (get-buffer-create " *temp*")))
- (with-current-buffer buf
- (widen)
- (erase-buffer)
- (insert string "\n")
- (if (string= "spell" spell-command)
- (call-process-region (point-min) (point-max) "spell"
- t t)
- (call-process-region (point-min) (point-max) shell-file-name
- t t nil "-c" spell-command))
- (if (= 0 (buffer-size))
- (message "%s is correct" string)
- (goto-char (point-min))
- (while (search-forward "\n" nil t)
- (replace-match " "))
- (message "%sincorrect" (buffer-substring 1 (point-max)))))))
-;;;###autoload
-(make-obsolete 'spell-string "The `spell' package is obsolete - use `ispell'."
- "23.1")
-
-(provide 'spell)
-
-;; arch-tag: 7eabb848-9c76-431a-bcdb-0e0592d2db04
-;;; spell.el ends here
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index 9d3c5001d0b..2dc4e4a88b1 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -1,12 +1,10 @@
;;; table.el --- create and edit WYSIWYG text based embedded tables
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2011 Free Software Foundation, Inc.
;; Keywords: wp, convenience
;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com>
;; Created: Sat Jul 08 2000 13:28:45 (PST)
-;; Revised: Fri Aug 21 2009 00:16:58 (PDT)
;; This file is part of GNU Emacs.
@@ -640,14 +638,10 @@
;;;
(defgroup table nil
- "Text based table manipulation utilities.
-See `table-insert' for examples about how to use."
+ "Text based table manipulation utilities."
:tag "Table"
:prefix "table-"
- :group 'editing
:group 'wp
- :group 'paragraphs
- :group 'fill
:version "22.1")
(defgroup table-hooks nil
@@ -655,7 +649,7 @@ See `table-insert' for examples about how to use."
:group 'table)
(defcustom table-time-before-update 0.2
- "*Time in seconds before updating the cell contents after typing.
+ "Time in seconds before updating the cell contents after typing.
Updating the cell contents on the screen takes place only after this
specified amount of time has passed after the last modification to the
cell contents. When the contents of a table cell changes repetitively
@@ -669,7 +663,7 @@ annoying delay before the typed result start appearing on the screen."
:group 'table)
(defcustom table-time-before-reformat 0.2
- "*Time in seconds before reformatting the table.
+ "Time in seconds before reformatting the table.
This many seconds must pass in addition to `table-time-before-update'
before the table is updated with newly widened width or heightened
height."
@@ -678,7 +672,7 @@ height."
:group 'table)
(defcustom table-command-prefix [(control c) (control c)]
- "*Key sequence to be used as prefix for table command key bindings."
+ "Key sequence to be used as prefix for table command key bindings."
:type '(vector (repeat :inline t sexp))
:tag "Table Command Prefix"
:group 'table)
@@ -689,30 +683,30 @@ height."
(((class color))
(:foreground "gray90" :background "blue"))
(t (:bold t)))
- "*Face used for table cell contents."
+ "Face used for table cell contents."
:tag "Cell Face"
:group 'table)
(defcustom table-cell-horizontal-chars "-="
- "*Characters that may be used for table cell's horizontal border line."
+ "Characters that may be used for table cell's horizontal border line."
:tag "Cell Horizontal Boundary Characters"
:type 'string
:group 'table)
(defcustom table-cell-vertical-char ?\|
- "*Character that forms table cell's vertical border line."
+ "Character that forms table cell's vertical border line."
:tag "Cell Vertical Boundary Character"
:type 'character
:group 'table)
(defcustom table-cell-intersection-char ?\+
- "*Character that forms table cell's corner."
+ "Character that forms table cell's corner."
:tag "Cell Intersection Character"
:type 'character
:group 'table)
(defcustom table-word-continuation-char ?\\
- "*Character that indicates word continuation into the next line.
+ "Character that indicates word continuation into the next line.
This character has a special meaning only in the fixed width mode,
that is when `table-fixed-width-mode' is non-nil . In the fixed width
mode this character indicates that the location is continuing into the
@@ -731,7 +725,7 @@ select a character that is unlikely to appear in your document."
(set variable value))
(defcustom table-fixed-width-mode nil
- "*Cell width is fixed when this is non-nil.
+ "Cell width is fixed when this is non-nil.
Normally it should be nil for allowing automatic cell width expansion
that widens a cell when it is necessary. When non-nil, typing in a
cell does not automatically expand the cell width. A word that is too
@@ -746,7 +740,7 @@ run-time."
:group 'table)
(defcustom table-detect-cell-alignment t
- "*Detect cell contents alignment automatically.
+ "Detect cell contents alignment automatically.
When non-nil cell alignment is automatically determined by the
appearance of the current cell contents when recognizing tables as a
whole. This applies to `table-recognize', `table-recognize-region'
@@ -756,38 +750,38 @@ and `table-recognize-table' but not to `table-recognize-cell'."
:group 'table)
(defcustom table-dest-buffer-name "table"
- "*Default buffer name (without a suffix) for source generation."
+ "Default buffer name (without a suffix) for source generation."
:tag "Source Buffer Name"
:type 'string
:group 'table)
(defcustom table-html-delegate-spacing-to-user-agent nil
- "*Non-nil delegates cell contents spacing entirely to user agent.
+ "Non-nil delegates cell contents spacing entirely to user agent.
Otherwise, when nil, it preserves the original spacing and line breaks."
:tag "HTML delegate spacing"
:type 'boolean
:group 'table)
(defcustom table-html-th-rows 0
- "*Number of top rows to become header cells automatically in HTML generation."
+ "Number of top rows to become header cells automatically in HTML generation."
:tag "HTML Header Rows"
:type 'integer
:group 'table)
(defcustom table-html-th-columns 0
- "*Number of left columns to become header cells automatically in HTML generation."
+ "Number of left columns to become header cells automatically in HTML generation."
:tag "HTML Header Columns"
:type 'integer
:group 'table)
(defcustom table-html-table-attribute "border=\"1\""
- "*Table attribute that applies to the table in HTML generation."
+ "Table attribute that applies to the table in HTML generation."
:tag "HTML table attribute"
:type 'string
:group 'table)
(defcustom table-html-cell-attribute ""
- "*Cell attribute that applies to all cells in HTML generation.
+ "Cell attribute that applies to all cells in HTML generation.
Do not specify \"align\" and \"valign\" because they are determined by
the cell contents dynamically."
:tag "HTML cell attribute"
@@ -795,28 +789,28 @@ the cell contents dynamically."
:group 'table)
(defcustom table-cals-thead-rows 1
- "*Number of top rows to become header rows in CALS table."
+ "Number of top rows to become header rows in CALS table."
:tag "CALS Header Rows"
:type 'integer
:group 'table)
;;;###autoload
(defcustom table-cell-map-hook nil
- "*Normal hooks run when finishing construction of `table-cell-map'.
+ "Normal hooks run when finishing construction of `table-cell-map'.
User can modify `table-cell-map' by adding custom functions here."
:tag "Cell Keymap Hooks"
:type 'hook
:group 'table-hooks)
(defcustom table-disable-incompatibility-warning nil
- "*Disable compatibility warning notice.
+ "Disable compatibility warning notice.
When nil user is reminded of known incompatible issues."
:tag "Disable Incompatibility Warning"
:type 'boolean
:group 'table)
(defcustom table-abort-recognition-when-input-pending t
- "*Abort current recognition process when input pending.
+ "Abort current recognition process when input pending.
Abort current recognition process when we are not sure that no input
is available. When non-nil lengthy recognition process is aborted
simply by any key input."
@@ -826,19 +820,19 @@ simply by any key input."
;;;###autoload
(defcustom table-load-hook nil
- "*List of functions to be called after the table is first loaded."
+ "List of functions to be called after the table is first loaded."
:type 'hook
:group 'table-hooks)
;;;###autoload
(defcustom table-point-entered-cell-hook nil
- "*List of functions to be called after point entered a table cell."
+ "List of functions to be called after point entered a table cell."
:type 'hook
:group 'table-hooks)
;;;###autoload
(defcustom table-point-left-cell-hook nil
- "*List of functions to be called after point left a table cell."
+ "List of functions to be called after point left a table cell."
:type 'hook
:group 'table-hooks)
@@ -864,7 +858,7 @@ time.")
;;; No need of user configuration
(defconst table-paragraph-start "[ \t\n\f]"
- "*Regexp for beginning of a line that starts OR separates paragraphs.")
+ "Regexp for beginning of a line that starts OR separates paragraphs.")
(defconst table-cache-buffer-name " *table cell cache*"
"Cell cache buffer name.")
(defvar table-cell-info-lu-coordinate nil
@@ -923,12 +917,12 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu
(defvar table-source-info-plist nil
"General storage for temporary information used while generating source.")
-;;; The following history containers not only keep the history of user
-;;; entries but also serve as the default value providers. When an
-;;; interactive command is invoked it offers a user the latest entry
-;;; of the history as a default selection. Therefore the values below
-;;; are the first default value when a command is invoked for the very
-;;; first time when there is no real history existing yet.
+;; The following history containers not only keep the history of user
+;; entries but also serve as the default value providers. When an
+;; interactive command is invoked it offers a user the latest entry
+;; of the history as a default selection. Therefore the values below
+;; are the first default value when a command is invoked for the very
+;; first time when there is no real history existing yet.
(defvar table-cell-span-direction-history '("right"))
(defvar table-cell-split-orientation-history '("horizontally"))
(defvar table-cell-split-contents-to-history '("split"))
@@ -952,19 +946,19 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu
(defvar table-capture-columns-history '(""))
(defvar table-target-history '("cell"))
-;;; Some entries in `table-cell-bindings' are duplicated in
-;;; `table-command-remap-alist'. There is a good reason for
-;;; this. Common key like return key may be taken by some other
-;;; function than normal `newline' function. Thus binding return key
-;;; directly for `*table--cell-newline' ensures that the correct enter
-;;; operation in a table cell. However
-;;; `table-command-remap-alist' has an additional role than
-;;; replacing commands. It is also used to construct a table command
-;;; list. This list is very important because it is used to check if
-;;; the previous command was one of them in this list or not. If the
-;;; previous command is found in the list the current command will not
-;;; refill the table cache. If the command were not listed fast
-;;; typing can cause unwanted cache refill.
+;; Some entries in `table-cell-bindings' are duplicated in
+;; `table-command-remap-alist'. There is a good reason for
+;; this. Common key like return key may be taken by some other
+;; function than normal `newline' function. Thus binding return key
+;; directly for `*table--cell-newline' ensures that the correct enter
+;; operation in a table cell. However
+;; `table-command-remap-alist' has an additional role than
+;; replacing commands. It is also used to construct a table command
+;; list. This list is very important because it is used to check if
+;; the previous command was one of them in this list or not. If the
+;; previous command is found in the list the current command will not
+;; refill the table cache. If the command were not listed fast
+;; typing can cause unwanted cache refill.
(defconst table-cell-bindings
'(([(control i)] . table-forward-cell)
([(control I)] . table-backward-cell)
@@ -5062,7 +5056,7 @@ Focus only on the corner pattern. Further cell validity check is required."
(intersection-str (regexp-quote (char-to-string table-cell-intersection-char)))
(v-border (format "[%c%c]" table-cell-vertical-char table-cell-intersection-char))
(h-border (format "[%s%c]" table-cell-horizontal-chars table-cell-intersection-char))
- (limit (save-excursion (beginning-of-line) (point))))
+ (limit (line-beginning-position)))
(catch 'end
(while t
(catch 'retry-horizontal
@@ -5100,7 +5094,7 @@ Focus only on the corner pattern. Further cell validity check is required."
(intersection-str (regexp-quote (char-to-string table-cell-intersection-char)))
(v-border (format "[%c%c]" table-cell-vertical-char table-cell-intersection-char))
(h-border (format "[%s%c]" table-cell-horizontal-chars table-cell-intersection-char))
- (limit (save-excursion (end-of-line) (point))))
+ (limit (line-end-position)))
(catch 'end
(while t
(catch 'retry-horizontal
@@ -5594,14 +5588,4 @@ It returns COLUMN unless STR contains some wide characters."
(provide 'table)
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Local Variables: ***
-;; time-stamp-line-limit: 16 ***
-;; time-stamp-start: ";; Revised:[ \t]+" ***
-;; time-stamp-end: "$" ***
-;; time-stamp-format: "%3a %3b %02d %:y %02H:%02M:%02S (%Z)" ***
-;; End: ***
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; arch-tag: 0d69b03e-aa5f-4e72-8806-5727217617e0
;;; table.el ends here
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index b33928bff42..428fc1db3a9 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1,7 +1,6 @@
;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*-
-;; Copyright (C) 1985, 1986, 1989, 1992, 1994, 1995, 1996, 1997, 1998
-;; 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Copyright (C) 1985-1986, 1989, 1992, 1994-1999, 2001-2011
;; Free Software Foundation, Inc.
;; Maintainer: FSF
@@ -58,14 +57,14 @@
;;;###autoload
(defcustom tex-shell-file-name nil
- "*If non-nil, the shell file name to run in the subshell used to run TeX."
+ "If non-nil, the shell file name to run in the subshell used to run TeX."
:type '(choice (const :tag "None" nil)
string)
:group 'tex-run)
;;;###autoload
(defcustom tex-directory (purecopy ".")
- "*Directory in which temporary files are written.
+ "Directory in which temporary files are written.
You can make this `/tmp' if your TEXINPUTS has no relative directories in it
and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are
`\\input' commands with relative directories."
@@ -84,7 +83,7 @@ if it matches the first line of the file,
;;;###autoload
(defcustom tex-main-file nil
- "*The main TeX source file which includes this buffer's file.
+ "The main TeX source file which includes this buffer's file.
The command `tex-file' runs TeX on the file specified by `tex-main-file'
if the variable is non-nil."
:type '(choice (const :tag "None" nil)
@@ -93,13 +92,13 @@ if the variable is non-nil."
;;;###autoload
(defcustom tex-offer-save t
- "*If non-nil, ask about saving modified buffers before \\[tex-file] is run."
+ "If non-nil, ask about saving modified buffers before \\[tex-file] is run."
:type 'boolean
:group 'tex-file)
;;;###autoload
(defcustom tex-run-command (purecopy "tex")
- "*Command used to run TeX subjob.
+ "Command used to run TeX subjob.
TeX Mode sets `tex-command' to this string.
See the documentation of that variable."
:type 'string
@@ -107,7 +106,7 @@ See the documentation of that variable."
;;;###autoload
(defcustom latex-run-command (purecopy "latex")
- "*Command used to run LaTeX subjob.
+ "Command used to run LaTeX subjob.
LaTeX Mode sets `tex-command' to this string.
See the documentation of that variable."
:type 'string
@@ -115,7 +114,7 @@ See the documentation of that variable."
;;;###autoload
(defcustom slitex-run-command (purecopy "slitex")
- "*Command used to run SliTeX subjob.
+ "Command used to run SliTeX subjob.
SliTeX Mode sets `tex-command' to this string.
See the documentation of that variable."
:type 'string
@@ -123,7 +122,7 @@ See the documentation of that variable."
;;;###autoload
(defcustom tex-start-options (purecopy "")
- "*TeX options to use when starting TeX.
+ "TeX options to use when starting TeX.
These immediately precede the commands in `tex-start-commands'
and the input file name, with no separating space and are not shell-quoted.
If nil, TeX runs with no options. See the documentation of `tex-command'."
@@ -133,7 +132,7 @@ If nil, TeX runs with no options. See the documentation of `tex-command'."
;;;###autoload
(defcustom tex-start-commands (purecopy "\\nonstopmode\\input")
- "*TeX commands to use when starting TeX.
+ "TeX commands to use when starting TeX.
They are shell-quoted and precede the input file name, with a separating space.
If nil, no commands are used. See the documentation of `tex-command'."
:type '(radio (const :tag "Interactive \(nil\)" nil)
@@ -157,14 +156,14 @@ If nil, no commands are used. See the documentation of `tex-command'."
;;;###autoload
(defcustom latex-block-names nil
- "*User defined LaTeX block names.
+ "User defined LaTeX block names.
Combined with `latex-standard-block-names' for minibuffer completion."
:type '(repeat string)
:group 'tex-run)
;;;###autoload
(defcustom tex-bibtex-command (purecopy "bibtex")
- "*Command used by `tex-bibtex-file' to gather bibliographic data.
+ "Command used by `tex-bibtex-file' to gather bibliographic data.
If this string contains an asterisk (`*'), that is replaced by the file name;
otherwise, the file name, preceded by blank, is added at the end."
:type 'string
@@ -172,7 +171,7 @@ otherwise, the file name, preceded by blank, is added at the end."
;;;###autoload
(defcustom tex-dvi-print-command (purecopy "lpr -d")
- "*Command used by \\[tex-print] to print a .dvi file.
+ "Command used by \\[tex-print] to print a .dvi file.
If this string contains an asterisk (`*'), that is replaced by the file name;
otherwise, the file name, preceded by blank, is added at the end."
:type 'string
@@ -180,7 +179,7 @@ otherwise, the file name, preceded by blank, is added at the end."
;;;###autoload
(defcustom tex-alt-dvi-print-command (purecopy "lpr -d")
- "*Command used by \\[tex-print] with a prefix arg to print a .dvi file.
+ "Command used by \\[tex-print] with a prefix arg to print a .dvi file.
If this string contains an asterisk (`*'), that is replaced by the file name;
otherwise, the file name, preceded by blank, is added at the end.
@@ -203,7 +202,7 @@ use."
((eq window-system 'x) ,(purecopy "xdvi"))
((eq window-system 'w32) ,(purecopy "yap"))
(t ,(purecopy "dvi2tty * | cat -s")))
- "*Command used by \\[tex-view] to display a `.dvi' file.
+ "Command used by \\[tex-view] to display a `.dvi' file.
If it is a string, that specifies the command directly.
If this string contains an asterisk (`*'), that is replaced by the file name;
otherwise, the file name, preceded by a space, is added at the end.
@@ -214,14 +213,14 @@ If the value is a form, it is evaluated to get the command to use."
;;;###autoload
(defcustom tex-show-queue-command (purecopy "lpq")
- "*Command used by \\[tex-show-print-queue] to show the print queue.
+ "Command used by \\[tex-show-print-queue] to show the print queue.
Should show the queue(s) that \\[tex-print] puts jobs on."
:type 'string
:group 'tex-view)
;;;###autoload
(defcustom tex-default-mode 'latex-mode
- "*Mode to enter for a new file that might be either TeX or LaTeX.
+ "Mode to enter for a new file that might be either TeX or LaTeX.
This variable is used when it can't be determined whether the file
is plain TeX or LaTeX or what because the file contains no commands.
Normally set to either `plain-tex-mode' or `latex-mode'."
@@ -230,14 +229,14 @@ Normally set to either `plain-tex-mode' or `latex-mode'."
;;;###autoload
(defcustom tex-open-quote (purecopy "``")
- "*String inserted by typing \\[tex-insert-quote] to open a quotation."
+ "String inserted by typing \\[tex-insert-quote] to open a quotation."
:type 'string
:options '("``" "\"<" "\"`" "<<" "«")
:group 'tex)
;;;###autoload
(defcustom tex-close-quote (purecopy "''")
- "*String inserted by typing \\[tex-insert-quote] to close a quotation."
+ "String inserted by typing \\[tex-insert-quote] to close a quotation."
:type 'string
:options '("''" "\">" "\"'" ">>" "»")
:group 'tex)
@@ -327,7 +326,7 @@ Set by \\[tex-region], \\[tex-buffer], and \\[tex-file].")
;;;;
(defcustom latex-imenu-indent-string ". "
- "*String to add repeated in front of nested sectional units for Imenu.
+ "String to add repeated in front of nested sectional units for Imenu.
An alternative value is \" . \", if you use a font with a narrow period."
:type 'string
:group 'tex)
@@ -488,10 +487,6 @@ An alternative value is \" . \", if you use a font with a narrow period."
;; (arg "\\(?:{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)\\|\\\\[a-z*]+\\)"))
(arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
(list
- ;; font-lock-syntactic-keywords causes the \ of \end{verbatim} to be
- ;; highlighted as tex-verbatim face. Let's undo that.
- ;; This is ugly and brittle :-( --Stef
- '("^\\(\\\\\\)end" (1 (get-text-property (match-end 1) 'face) t))
;; display $$ math $$
;; We only mark the match between $$ and $$ because the $$ delimiters
;; themselves have already been marked (along with $..$) by syntactic
@@ -642,28 +637,90 @@ An alternative value is \" . \", if you use a font with a narrow period."
(put 'tex-verbatim-environments 'safe-local-variable
(lambda (x) (null (delq t (mapcar 'stringp x)))))
-(defvar tex-font-lock-syntactic-keywords
- '((eval . `(,(concat "^\\\\begin *{"
- (regexp-opt tex-verbatim-environments t)
- "}.*\\(\n\\)") 2 "|"))
- ;; Technically, we'd like to put the "|" property on the \n preceding
- ;; the \end, but this would have 2 disadvantages:
- ;; 1 - it's wrong if the verbatim env is empty (the same \n is used to
- ;; start and end the fenced-string).
- ;; 2 - font-lock considers the preceding \n as being part of the
- ;; preceding line, so things gets screwed every time the previous
- ;; line is re-font-locked on its own.
- ;; There's a hack in tex-font-lock-keywords-1 to remove the verbatim
- ;; face from the \ but C-M-f still jumps to the wrong spot :-( --Stef
- (eval . `(,(concat "^\\(\\\\\\)end *{"
- (regexp-opt tex-verbatim-environments t)
- "}\\(.?\\)") (1 "|") (3 "<")))
- ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
- ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
+(eval-when-compile
+ (defconst tex-syntax-propertize-rules
+ (syntax-propertize-precompile-rules
("\\\\verb\\**\\([^a-z@*]\\)"
- ;; Do it last, because it uses syntax-ppss which needs the
- ;; syntax-table properties of previous entries.
- 1 (tex-font-lock-verb (match-end 1)))))
+ (1 (prog1 "\""
+ (tex-font-lock-verb
+ (match-beginning 0) (char-after (match-beginning 1))))))))
+
+ (defconst latex-syntax-propertize-rules
+ (syntax-propertize-precompile-rules
+ tex-syntax-propertize-rules
+ ("\\\\\\(?:end\\|begin\\) *\\({[^\n{}]*}\\)"
+ (1 (ignore
+ (tex-env-mark (match-beginning 0)
+ (match-beginning 1) (match-end 1))))))))
+
+(defun tex-env-mark (cmd start end)
+ (when (= cmd (line-beginning-position))
+ (let ((arg (buffer-substring-no-properties (1+ start) (1- end))))
+ (when (member arg tex-verbatim-environments)
+ (if (eq ?b (char-after (1+ cmd)))
+ ;; \begin
+ (put-text-property (line-end-position)
+ (line-beginning-position 2)
+ 'syntax-table (string-to-syntax "< c"))
+ ;; In the case of an empty verbatim env, the \n after the \begin is
+ ;; the same as the \n before the \end. Lucky for us, the "> c"
+ ;; property associated to the \end will be placed afterwards, so it
+ ;; will override the "< c".
+ (put-text-property (1- cmd) cmd
+ 'syntax-table (string-to-syntax "> c"))
+ ;; The text between \end{verbatim} and \n is ignored, so we'll treat
+ ;; it as a comment.
+ (put-text-property end (min (1+ end) (line-end-position))
+ 'syntax-table (string-to-syntax "<"))))))
+ ;; Mark env args for possible electric pairing.
+ (unless (get-char-property (1+ start) 'text-clones) ;Already paired-up.
+ (put-text-property start end 'latex-env-pair t)))
+
+(define-minor-mode latex-electric-env-pair-mode
+ "Automatically update the \\end arg when editing the \\begin one.
+And vice-versa."
+ :lighter "/e"
+ (if latex-electric-env-pair-mode
+ (add-hook 'before-change-functions
+ #'latex-env-before-change nil 'local)
+ (remove-hook 'before-change-functions
+ #'latex-env-before-change 'local)))
+
+(defun latex-env-before-change (start end)
+ (when (get-text-property start 'latex-env-pair)
+ (condition-case err
+ (with-silent-modifications
+ ;; Remove properties even if don't find a pair.
+ (remove-text-properties
+ (previous-single-property-change (1+ start) 'latex-env-pair)
+ (next-single-property-change start 'latex-env-pair)
+ '(latex-env-pair))
+ (unless (or (get-char-property start 'text-clones)
+ (get-char-property (1+ start) 'text-clones)
+ (save-excursion
+ (goto-char start)
+ (not (re-search-backward
+ "\\\\\\(?:end\\|begi\\(n\\)\\) *{"
+ (line-beginning-position) t))))
+ (let ((cmd-start (match-beginning 0))
+ (type (match-end 1)) ;nil for \end, else \begin.
+ (arg-start (1- (match-end 0))))
+ (save-excursion
+ (goto-char (match-end 0))
+ (when (and (looking-at "[^\n{}]*}")
+ (> (match-end 0) end))
+ (let ((arg-end (match-end 0)))
+ (if (null type) ;\end
+ (progn (goto-char arg-end)
+ (latex-forward-sexp -1) (forward-word 1))
+ (goto-char cmd-start)
+ (latex-forward-sexp 1)
+ (let (forward-sexp-function) (backward-sexp)))
+ (when (looking-at
+ (regexp-quote (buffer-substring arg-start arg-end)))
+ (text-clone-create arg-start arg-end))))))))
+ (scan-error nil)
+ (error (message "Error in latex-env-before-change: %s" err)))))
(defun tex-font-lock-unfontify-region (beg end)
(font-lock-default-unfontify-region beg end)
@@ -730,37 +787,35 @@ Not smaller than the value set by `tex-suscript-height-minimum'."
(define-obsolete-face-alias 'tex-verbatim-face 'tex-verbatim "22.1")
(defvar tex-verbatim-face 'tex-verbatim)
-(defun tex-font-lock-verb (end)
- "Place syntax-table properties on the \verb construct.
-END is the position of the first delimiter after \verb."
- (unless (nth 8 (syntax-ppss end))
- ;; Do nothing if the \verb construct is itself inside a comment or
- ;; verbatim env.
- (save-excursion
- ;; Let's find the end and mark it.
- ;; We used to do it inside tex-font-lock-syntactic-face-function, but
- ;; this leads to funny effects when jumping to the end of the buffer,
- ;; because font-lock applies font-lock-syntactic-keywords to the whole
- ;; preceding text but font-lock-syntactic-face-function only to the
- ;; actually displayed text.
- (goto-char end)
- (let ((char (char-before)))
- (skip-chars-forward (string ?^ char)) ;; Use `end' ?
+(defun tex-font-lock-verb (start delim)
+ "Place syntax table properties on the \verb construct.
+START is the position of the \\ and DELIM is the delimiter char."
+ ;; Do nothing if the \verb construct is itself inside a comment or
+ ;; verbatim env.
+ (unless (nth 8 (save-excursion (syntax-ppss start)))
+ ;; Let's find the end and mark it.
+ (let ((afterdelim (point)))
+ (skip-chars-forward (string ?^ delim) (line-end-position))
+ (if (eolp)
+ ;; "LaTeX Error: \verb ended by end of line."
+ ;; Remove the syntax-table property we've just put on the
+ ;; start-delimiter, so it doesn't spill over subsequent lines.
+ (put-text-property (1- afterdelim) afterdelim
+ 'syntax-table nil)
(when (eq (char-syntax (preceding-char)) ?/)
- (put-text-property (1- (point)) (point) 'syntax-table '(1)))
- (unless (eobp)
- (put-text-property (point) (1+ (point)) 'syntax-table '(7))
- ;; Cause the rest of the buffer to be re-fontified.
- ;; (remove-text-properties (1+ (point)) (point-max) '(fontified))
- )))
- "\""))
+ (put-text-property (1- (point)) (point)
+ 'syntax-table (string-to-syntax ".")))
+ (put-text-property (point) (1+ (point))
+ 'syntax-table (string-to-syntax "\""))))))
;; Use string syntax but math face for $...$.
(defun tex-font-lock-syntactic-face-function (state)
(let ((char (nth 3 state)))
(cond
- ((not char) font-lock-comment-face)
+ ((not char)
+ (if (eq 2 (nth 7 state)) tex-verbatim-face font-lock-comment-face))
((eq char ?$) tex-math-face)
+ ;; A \verb element.
(t tex-verbatim-face))))
@@ -808,6 +863,12 @@ END is the position of the first delimiter after \verb."
(define-key map "\C-c\C-c" 'tex-compile)
(define-key map "\C-c\C-i" 'tex-bibtex-file)
(define-key map "\C-c\C-o" 'latex-insert-block)
+
+ ;; Redundant keybindings, for consistency with SGML mode.
+ (define-key map "\C-c\C-t" 'latex-insert-block)
+ (define-key map "\C-c]" 'latex-close-block)
+ (define-key map "\C-c/" 'latex-close-block)
+
(define-key map "\C-c\C-e" 'latex-close-block)
(define-key map "\C-c\C-u" 'tex-goto-last-unclosed-latex-block)
(define-key map "\C-c\C-m" 'tex-feed-input)
@@ -1158,10 +1219,9 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook
(font-lock-syntactic-face-function
. tex-font-lock-syntactic-face-function)
(font-lock-unfontify-region-function
- . tex-font-lock-unfontify-region)
- (font-lock-syntactic-keywords
- . tex-font-lock-syntactic-keywords)
- (parse-sexp-lookup-properties . t)))
+ . tex-font-lock-unfontify-region)))
+ (set (make-local-variable 'syntax-propertize-function)
+ (syntax-propertize-rules latex-syntax-propertize-rules))
;; TABs in verbatim environments don't do what you think.
(set (make-local-variable 'indent-tabs-mode) nil)
;; Other vars that should be buffer-local.
@@ -1752,11 +1812,70 @@ Mark is left at original location."
;; Why use a shell instead of running TeX directly? Because if TeX
;; gets stuck, the user can switch to the shell window and type at it.
+(defvar tex-error-parse-syntax-table
+ (let ((st (make-syntax-table)))
+ (modify-syntax-entry ?\( "()" st)
+ (modify-syntax-entry ?\) ")(" st)
+ (modify-syntax-entry ?\\ "\\" st)
+ (modify-syntax-entry ?\{ "_" st)
+ (modify-syntax-entry ?\} "_" st)
+ (modify-syntax-entry ?\[ "_" st)
+ (modify-syntax-entry ?\] "_" st)
+ ;; Single quotations may appear in errors
+ (modify-syntax-entry ?\" "_" st)
+ st)
+ "Syntax-table used while parsing TeX error messages.")
+
+(defun tex-old-error-file-name ()
+ ;; This is unreliable, partly because we don't try very hard, and
+ ;; partly because TeX's output format is eminently ambiguous and unfriendly
+ ;; to automation.
+ (save-excursion
+ (save-match-data
+ (with-syntax-table tex-error-parse-syntax-table
+ (beginning-of-line)
+ (backward-up-list 1)
+ (skip-syntax-forward "(_")
+ (while (not (let ((try-filename (thing-at-point 'filename)))
+ (and try-filename
+ (not (string= "" try-filename))
+ (file-readable-p try-filename))))
+ (skip-syntax-backward "(_")
+ (backward-up-list 1)
+ (skip-syntax-forward "(_"))
+ (thing-at-point 'filename)))))
+
+(defconst tex-error-regexp-alist
+ ;; First alternative handles the newer --file-line-error style:
+ ;; ./test2.tex:14: Too many }'s.
+ '(gnu
+ ;; Second handles the old-style, which spans two lines but doesn't include
+ ;; any file info:
+ ;; ! Too many }'s.
+ ;; l.396 toto}
+ ("^l\\.\\([1-9][0-9]*\\) \\(?:\\.\\.\\.\\)?\\(.*\\)$"
+ tex-old-error-file-name 1 nil nil nil
+ ;; Since there's no filename to highlight, let's highlight the message.
+ (2 compilation-error-face))
+ ;; A few common warning messages.
+ ("^\\(?:Und\\|Ov\\)erfull \\\\[hv]box .* at lines? \\(\\([1-9][0-9]*\\)\\(?:--\\([1-9][0-9]*\\)\\)?\\)$"
+ tex-old-error-file-name (2 . 3) nil 1 nil
+ (1 compilation-warning-face))
+ ("^(Font) *\\([^ \n].* on input line \\([1-9][0-9]*\\)\\)\\.$"
+ tex-old-error-file-name 2 nil 1 1
+ (2 compilation-warning-face))
+ ;; Included files get output as (<file> ...).
+ ;; FIXME: there tend to be a crapload of them at the beginning of the
+ ;; output which aren't that interesting. Maybe we should filter out
+ ;; all the file name that start with /usr/share?
+ ;; ("(\\.?/\\([^() \n]+\\)" 1 nil nil 0)
+ ))
+
;; The utility functions:
(define-derived-mode tex-shell shell-mode "TeX-Shell"
- (set (make-local-variable 'compilation-parse-errors-function)
- 'tex-compilation-parse-errors)
+ (set (make-local-variable 'compilation-error-regexp-alist)
+ tex-error-regexp-alist)
(compilation-shell-minor-mode t))
;;;###autoload
@@ -2254,113 +2373,6 @@ Only applies the FSPEC to the args part of FORMAT."
(tex-display-shell)
(setq tex-last-buffer-texed (current-buffer)))
-(defvar tex-error-parse-syntax-table
- (let ((st (make-syntax-table)))
- (modify-syntax-entry ?\( "()" st)
- (modify-syntax-entry ?\) ")(" st)
- (modify-syntax-entry ?\\ "\\" st)
- (modify-syntax-entry ?\{ "_" st)
- (modify-syntax-entry ?\} "_" st)
- (modify-syntax-entry ?\[ "_" st)
- (modify-syntax-entry ?\] "_" st)
- ;; Single quotations may appear in errors
- (modify-syntax-entry ?\" "_" st)
- st)
- "Syntax-table used while parsing TeX error messages.")
-
-(defun tex-compilation-parse-errors (limit-search find-at-least)
- "Parse the current buffer as TeX error messages.
-See the variable `compilation-parse-errors-function' for the interface it uses.
-
-This function parses only the last TeX compilation.
-It works on TeX compilations only. It is necessary for that purpose,
-since TeX does not put file names and line numbers on the same line as
-for the error messages."
- (require 'thingatpt)
- (setq compilation-error-list nil)
- (let ((default-directory ; Perhaps dir has changed meanwhile.
- (file-name-directory (buffer-file-name tex-last-buffer-texed)))
- found-desired (num-errors-found 0)
- last-filename last-linenum last-position
- begin-of-error end-of-error errfilename)
- ;; Don't reparse messages already seen at last parse.
- (goto-char compilation-parsing-end)
- ;; Parse messages.
- (while (and (not (or found-desired (eobp)))
- ;; First alternative handles the newer --file-line-error style:
- ;; ./test2.tex:14: Too many }'s.
- ;; Second handles the old-style:
- ;; ! Too many }'s.
- (prog1 (re-search-forward
- "^\\(?:\\([^:\n]+\\):[[:digit:]]+:\\|!\\) " nil 'move)
- (setq begin-of-error (match-beginning 0)
- end-of-error (match-end 0)
- errfilename (match-string 1)))
- (re-search-forward
- "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move))
- (let* ((this-error (copy-marker begin-of-error))
- (linenum (string-to-number (match-string 1)))
- (error-text (regexp-quote (match-string 3)))
- try-filename
- (filename
- ;; Prefer --file-liner-error filename if we have it.
- (or errfilename
- (save-excursion
- (with-syntax-table tex-error-parse-syntax-table
- (backward-up-list 1)
- (skip-syntax-forward "(_")
- (while (not
- (and (setq try-filename (thing-at-point
- 'filename))
- (not (string= "" try-filename))
- (file-readable-p try-filename)))
- (skip-syntax-backward "(_")
- (backward-up-list 1)
- (skip-syntax-forward "(_"))
- (thing-at-point 'filename)))))
- (new-file
- (or (null last-filename)
- (not (string-equal last-filename filename))))
- (error-location
- (with-current-buffer
- (if (equal filename (concat tex-zap-file ".tex"))
- tex-last-buffer-texed
- (find-file-noselect filename))
- (save-excursion
- (if new-file
- (progn
- (goto-char (point-min))
- (forward-line (1- linenum))
- (setq last-position nil))
- (goto-char last-position)
- (forward-line (- linenum last-linenum)))
- ;; first try a forward search for the error text,
- ;; then a backward search limited by the last error.
- (let ((starting-point (point)))
- (or (re-search-forward error-text nil t)
- (re-search-backward error-text last-position t)
- (goto-char starting-point)))
- (point-marker)))))
- (goto-char this-error)
- (if (and compilation-error-list
- (or (and find-at-least
- (>= num-errors-found
- find-at-least))
- (and limit-search
- (>= end-of-error limit-search)))
- new-file)
- (setq found-desired t)
- (setq num-errors-found (1+ num-errors-found)
- last-filename filename
- last-linenum linenum
- last-position error-location
- compilation-error-list ; Add the new error
- (cons (cons this-error error-location)
- compilation-error-list))
- (goto-char end-of-error)))))
- (set-marker compilation-parsing-end (point))
- (setq compilation-error-list (nreverse compilation-error-list)))
-
;;; The commands:
(defun tex-region (beg end)
@@ -2807,15 +2819,15 @@ There might be text before point."
;; syntax-table can't deal with. We could turn it
;; into a non-comment, or use `\n%' or `%^' as the comment.
;; Instead, we include it in the ^^A comment.
- (eval-when-compile (string-to-syntax "< b"))
- (eval-when-compile (string-to-syntax ">"))))
+ (string-to-syntax "< b")
+ (string-to-syntax ">")))
(let ((end (line-end-position)))
(if (< end (point-max))
(put-text-property
end (1+ end)
'syntax-table
- (eval-when-compile (string-to-syntax "> b")))))
- (eval-when-compile (string-to-syntax "< b")))))
+ (string-to-syntax "> b"))))
+ (string-to-syntax "< b"))))
(defun doctex-font-lock-syntactic-face-function (state)
;; Mark DocTeX documentation, which is parsed as a style A comment
@@ -2827,11 +2839,12 @@ There might be text before point."
(tex-font-lock-syntactic-face-function state)
font-lock-doc-face))
-(defvar doctex-font-lock-syntactic-keywords
- (append
- tex-font-lock-syntactic-keywords
- ;; For DocTeX comment-in-doc.
- `(("\\(\\^\\)\\^A" (1 (doctex-font-lock-^^A))))))
+(eval-when-compile
+ (defconst doctex-syntax-propertize-rules
+ (syntax-propertize-precompile-rules
+ latex-syntax-propertize-rules
+ ;; For DocTeX comment-in-doc.
+ ("\\(\\^\\)\\^A" (1 (doctex-font-lock-^^A))))))
(defvar doctex-font-lock-keywords
(append tex-font-lock-keywords
@@ -2845,16 +2858,15 @@ There might be text before point."
(mapcar
(lambda (x)
(case (car-safe x)
- (font-lock-syntactic-keywords
- (cons (car x) 'doctex-font-lock-syntactic-keywords))
(font-lock-syntactic-face-function
(cons (car x) 'doctex-font-lock-syntactic-face-function))
(t x)))
- (cdr font-lock-defaults)))))
+ (cdr font-lock-defaults))))
+ (set (make-local-variable 'syntax-propertize-function)
+ (syntax-propertize-rules doctex-syntax-propertize-rules)))
(run-hooks 'tex-mode-load-hook)
(provide 'tex-mode)
-;; arch-tag: c0a680b1-63aa-4547-84b9-4193c29c0080
;;; tex-mode.el ends here
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index 3dea075a8c1..d33cbb97dd8 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -1,8 +1,7 @@
;;; texinfmt.el --- format Texinfo files into Info files
-;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993,
-;; 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1988, 1990-1998, 2000-2011
+;; Free Software Foundation, Inc.
;; Maintainer: Robert J. Chassell <bug-texinfo@gnu.org>
;; Keywords: maint, tex, docs
@@ -224,7 +223,7 @@ converted to Info is stored in a temporary buffer."
(save-restriction
(widen)
(goto-char (point-min))
- (let ((search-end (save-excursion (forward-line 100) (point))))
+ (let ((search-end (line-beginning-position 101)))
(if (or
;; Either copy header text.
(and
@@ -285,7 +284,7 @@ converted to Info is stored in a temporary buffer."
(let ((filename (concat input-directory
(texinfo-parse-line-arg))))
(re-search-backward "^@include")
- (delete-region (point) (save-excursion (forward-line 1) (point)))
+ (delete-region (point) (line-beginning-position 2))
(message "Reading included file: %s" filename)
(save-excursion
(save-restriction
@@ -323,8 +322,7 @@ converted to Info is stored in a temporary buffer."
;; Insert Info region title text.
(goto-char (point-min))
- (if (search-forward
- "@setfilename" (save-excursion (forward-line 100) (point)) t)
+ (if (search-forward "@setfilename" (line-beginning-position 101) t)
(progn
(setq texinfo-command-end (point))
(beginning-of-line)
@@ -664,11 +662,12 @@ Do not append @refill to paragraphs containing @w{TEXT} or @*."
;; Else
;; 3. Do not refill a paragraph containing @w or @*, or ending
;; with @<newline> followed by a newline.
- (if (or (>= (point) (point-max))
- (re-search-forward
- "@w{\\|@\\*\\|@\n\n"
- (save-excursion (forward-paragraph) (forward-line 1) (point))
- t))
+ (if (or (>= (point) (point-max))
+ (re-search-forward
+ "@w{\\|@\\*\\|@\n\n"
+ (save-excursion (forward-paragraph)
+ (line-beginning-position 2))
+ t))
;; Go to end of paragraph and do nothing.
(forward-paragraph)
;; 4. Else go to end of paragraph and insert @refill
@@ -772,13 +771,13 @@ commands."
((eq type '@raisesections)
(setq level (1+ level))
(delete-region
- (point) (save-excursion (forward-line 1) (point))))
+ (point) (line-beginning-position 2)))
;; 2. Decrement level
((eq type '@lowersections)
(setq level (1- level))
(delete-region
- (point) (save-excursion (forward-line 1) (point))))
+ (point) (line-beginning-position 2)))
;; Now handle structuring commands
((cond
@@ -945,8 +944,8 @@ insert the text with the @insertcopying command."
(end (progn (re-search-forward "^@end copying[ \t]*\n") (point))))
(setq texinfo-copying-text
(buffer-substring-no-properties
- (save-excursion (goto-char beg) (forward-line 1) (point))
- (save-excursion (goto-char end) (forward-line -1) (point))))
+ (save-excursion (goto-char beg) (line-beginning-position 2))
+ (save-excursion (goto-char end) (line-beginning-position 0))))
(delete-region beg end)))
(defun texinfo-insertcopying ()
@@ -1505,9 +1504,7 @@ The node is constructed automatically."
(progn (goto-char node-name-beginning) ; skip over node command
(skip-chars-forward " \t") ; and over spaces
(point))
- (if (search-forward
- ","
- (save-excursion (end-of-line) (point)) t) ; bound search
+ (if (search-forward "," (line-end-position) t) ; bound search
(1- (point))
(end-of-line) (point))))))
(texinfo-discard-command) ; remove or insert whitespace, as needed
@@ -1692,7 +1689,7 @@ Used by @refill indenting command to avoid indenting within lists, etc.")
(put 'itemize 'texinfo-item 'texinfo-itemize-item)
(defun texinfo-itemize-item ()
;; (texinfo-discard-line) ; Did not handle text on same line as @item.
- (delete-region (1+ (point)) (save-excursion (beginning-of-line) (point)))
+ (delete-region (1+ (point)) (line-beginning-position))
(if (looking-at "[ \t]*[^ \t\n]+")
;; Text on same line as @item command.
(insert "\b " (nth 1 (car texinfo-stack)) " \n")
@@ -2132,10 +2129,10 @@ This command is executed when texinfmt sees @item inside @multitable."
(narrow-to-region start end)
;; Remove whitespace before and after entry.
(skip-chars-forward " ")
- (delete-region (point) (save-excursion (beginning-of-line) (point)))
+ (delete-region (point) (line-beginning-position))
(goto-char (point-max))
(skip-chars-backward " ")
- (delete-region (point) (save-excursion (end-of-line) (point)))
+ (delete-region (point) (line-end-position))
;; Temporarily set texinfo-stack to nil so texinfo-format-scan
;; does not see an unterminated @multitable.
(let (texinfo-stack) ; nil
@@ -2409,16 +2406,14 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image."
(let ((start (1- (point)))
args)
(skip-chars-forward " ")
- (save-excursion (end-of-line) (setq texinfo-command-end (point)))
+ (setq texinfo-command-end (line-end-position))
(if (not (looking-at "\\([^=]+\\)=\\(.*\\)"))
(error "Invalid alias command")
(push (cons
(match-string-no-properties 1)
(match-string-no-properties 2))
texinfo-alias-list)
- (texinfo-discard-command))
- )
- )
+ (texinfo-discard-command))))
;;; @var, @code and the like
@@ -2455,7 +2450,7 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image."
"Insert ` ... ' around arg unless inside a table; in that case, no quotes."
;; `looking-at-backward' not available in v. 18.57, 20.2
(if (not (search-backward "" ; searched-for character is a control-H
- (save-excursion (beginning-of-line) (point))
+ (line-beginning-position)
t))
(insert "`" (texinfo-parse-arg-discard) "'")
(insert (texinfo-parse-arg-discard)))
@@ -2507,7 +2502,7 @@ For example, @verb\{|@|\} results in @ and
(error "Not found: @verb start brace"))
(delete-region texinfo-command-start (+ 2 texinfo-command-end))
(search-forward delimiter))
- (delete-backward-char 1)
+ (delete-char -1)
(unless (looking-at "}")
(error "Not found: @verb end brace"))
(delete-char 1))
@@ -2840,8 +2835,7 @@ Default is to leave paragraph indentation as is."
(defun texinfo-noindent ()
(save-excursion
(forward-paragraph 1)
- (if (search-backward "@refill"
- (save-excursion (forward-line -1) (point)) t)
+ (if (search-backward "@refill" (line-beginning-position 0) t)
() ; leave @noindent command so @refill command knows not to indent
;; else
(texinfo-discard-line))))
@@ -4303,5 +4297,4 @@ For example, invoke
;;; Place `provide' at end of file.
(provide 'texinfmt)
-;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725
;;; texinfmt.el ends here
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index b3d252abe24..7e9ce9aff6d 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -1,7 +1,6 @@
;;; texinfo.el --- major mode for editing Texinfo files -*- coding: utf-8 -*-
-;; Copyright (C) 1985, 1988, 1989, 1990, 1991, 1992, 1993, 1996, 1997,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Copyright (C) 1985, 1988-1993, 1996-1997, 2000-2011
;; Free Software Foundation, Inc.
;; Author: Robert J. Chassell
@@ -310,19 +309,21 @@ chapter."
("Chapters" "^@chapter[ \t]+\\(.*\\)$" 1))
"Imenu generic expression for Texinfo mode. See `imenu-generic-expression'.")
-(defvar texinfo-font-lock-syntactic-keywords
- '(("\\(@\\)c\\(omment\\)?\\>" (1 "<"))
- ("^\\(@\\)ignore\\>" (1 "< b"))
- ("^@end ignore\\(\n\\)" (1 "> b")))
+(defconst texinfo-syntax-propertize-function
+ (syntax-propertize-rules
+ ("\\(@\\)c\\(omment\\)?\\>" (1 "<"))
+ ("^\\(@\\)ignore\\>" (1 "< b"))
+ ("^@end ignore\\(\n\\)" (1 "> b")))
"Syntactic keywords to catch comment delimiters in `texinfo-mode'.")
(defconst texinfo-environments
'("cartouche" "copying" "defcv" "deffn" "defivar" "defmac"
- "defmethod" "defop" "defopt" "defspec" "deftp" "deftypefn"
- "deftypefun" "deftypevar" "deftypevr" "defun" "defvar"
+ "defmethod" "defop" "defopt" "defspec" "deftp" "deftypecv"
+ "deftypefn" "deftypefun" "deftypeivar" "deftypemethod"
+ "deftypeop" "deftypevar" "deftypevr" "defun" "defvar"
"defvr" "description" "detailmenu" "direntry" "display"
"documentdescription" "enumerate" "example" "flushleft"
- "flushright" "format" "ftable" "group" "ifclear" "ifset"
+ "flushright" "format" "ftable" "group" "html" "ifclear" "ifset"
"ifhtml" "ifinfo" "ifnothtml" "ifnotinfo" "ifnotplaintext"
"ifnottex" "ifplaintext" "iftex" "ignore" "itemize" "lisp"
"macro" "menu" "multitable" "quotation" "smalldisplay"
@@ -442,7 +443,9 @@ Subexpression 1 is what goes into the corresponding `@end' statement.")
(define-key map "\C-c\C-s" 'texinfo-show-structure)
(define-key map "\C-c}" 'up-list)
+ ;; FIXME: This is often used for "close block" aka texinfo-insert-@end.
(define-key map "\C-c]" 'up-list)
+ (define-key map "\C-c/" 'texinfo-insert-@end)
(define-key map "\C-c{" 'texinfo-insert-braces)
;; bindings for inserting strings
@@ -582,11 +585,8 @@ value of `texinfo-mode-hook'."
(concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
(make-local-variable 'paragraph-start)
(setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
- (make-local-variable 'sentence-end-base)
- (setq sentence-end-base
+ (set (make-local-variable 'sentence-end-base)
"\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*")
- (make-local-variable 'adaptive-fill-mode)
- (setq adaptive-fill-mode nil)
(make-local-variable 'fill-column)
(setq fill-column 70)
(make-local-variable 'comment-start)
@@ -600,9 +600,9 @@ value of `texinfo-mode-hook'."
(setq imenu-case-fold-search nil)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults
- '(texinfo-font-lock-keywords nil nil nil backward-paragraph
- (font-lock-syntactic-keywords
- . texinfo-font-lock-syntactic-keywords)))
+ '(texinfo-font-lock-keywords nil nil nil backward-paragraph))
+ (set (make-local-variable 'syntax-propertize-function)
+ texinfo-syntax-propertize-function)
(set (make-local-variable 'parse-sexp-lookup-properties) t)
;; Outline settings.
@@ -645,7 +645,13 @@ Puts point on a blank line between them."
(completing-read (format "Block name [%s]: " texinfo-block-default)
texinfo-environments
nil nil nil nil texinfo-block-default))
- \n "@" str \n _ \n "@end " str \n)
+ \n "@" str
+ ;; Blocks that take parameters: all the def* blocks take parameters,
+ ;; plus a few others.
+ (if (or (string-match "\\`def" str)
+ (member str '("table" "ftable" "vtable")))
+ '(nil " " -))
+ \n _ \n "@end " str \n)
(defun texinfo-inside-macro-p (macro &optional bound)
"Non-nil if inside a macro matching the regexp MACRO."
@@ -716,163 +722,131 @@ With prefix argument or inside @code or @example, inserts a plain \"."
(not (looking-at "@end"))))
(texinfo-next-unmatched-end)))
-(defun texinfo-insert-@end ()
+(define-skeleton texinfo-insert-@end
"Insert the matching `@end' for the last Texinfo command that needs one."
- (interactive)
- (let ((string
(ignore-errors
(save-excursion
+ (backward-word 1)
(texinfo-last-unended-begin)
- (match-string 1)))))
- (insert "@end ")
- (if string (insert string "\n"))))
-
-;; The following insert commands accept a prefix arg N, which is the
-;; number of words (actually s-exprs) that should be surrounded by
-;; braces. Thus you can first paste a variable name into a .texinfo
-;; buffer, then say C-u 1 C-c C-c v at the beginning of the just
-;; pasted variable name to put @var{...} *around* the variable name.
-;; Operate on previous word or words with negative arg.
-
-;; These commands use texinfo-insert-@-with-arg
-(defun texinfo-insert-@-with-arg (string &optional arg)
- (if arg
- (progn
- (setq arg (prefix-numeric-value arg))
- (if (< arg 0)
- (progn
- (skip-chars-backward " \t\n\r\f")
- (save-excursion
- (forward-sexp arg)
- (insert "@" string "{"))
- (insert "}"))
- (skip-chars-forward " \t\n\r\f")
- (insert "@" string "{")
- (forward-sexp arg)
- (insert "}")))
- (insert "@" string "{}")
- (backward-char)))
-
-(defun texinfo-insert-braces ()
+ (or (match-string 1) '-)))
+ \n "@end " str \n)
+
+(define-skeleton texinfo-insert-braces
"Make a pair of braces and be poised to type inside of them.
Use \\[up-list] to move forward out of the braces."
- (interactive)
- (insert "{}")
- (backward-char))
+ nil
+ "{" _ "}")
-(defun texinfo-insert-@code (&optional arg)
+(define-skeleton texinfo-insert-@code
"Insert a `@code{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "code" arg))
+ nil
+ "@code{" _ "}")
-(defun texinfo-insert-@dfn (&optional arg)
+(define-skeleton texinfo-insert-@dfn
"Insert a `@dfn{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "dfn" arg))
+ nil
+ "@dfn{" _ "}")
-(defun texinfo-insert-@email (&optional arg)
+(define-skeleton texinfo-insert-@email
"Insert a `@email{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "email" arg))
+ nil
+ "@email{" _ "}")
-(defun texinfo-insert-@emph (&optional arg)
+(define-skeleton texinfo-insert-@emph
"Insert a `@emph{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "emph" arg))
+ nil
+ "@emph{" _ "}")
-(defun texinfo-insert-@example ()
+(define-skeleton texinfo-insert-@example
"Insert the string `@example' in a Texinfo buffer."
- (interactive)
- (insert "@example\n"))
+ nil
+ \n "@example" \n)
-(defun texinfo-insert-@file (&optional arg)
+(define-skeleton texinfo-insert-@file
"Insert a `@file{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "file" arg))
+ nil
+ "@file{" _ "}")
-(defun texinfo-insert-@item ()
+(define-skeleton texinfo-insert-@item
"Insert the string `@item' in a Texinfo buffer.
If in a table defined by @table, follow said string with a space.
Otherwise, follow with a newline."
- (interactive)
- (insert "@item"
+ nil
+ \n "@item"
(if (equal (ignore-errors
(save-excursion
(texinfo-last-unended-begin)
(match-string 1)))
"table")
- ?\s
- ?\n)))
+ " " '\n)
+ _ \n)
-(defun texinfo-insert-@kbd (&optional arg)
+(define-skeleton texinfo-insert-@kbd
"Insert a `@kbd{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "kbd" arg))
+ nil
+ "@kbd{" _ "}")
-(defun texinfo-insert-@node ()
+(define-skeleton texinfo-insert-@node
"Insert the string `@node' in a Texinfo buffer.
Insert a comment on the following line indicating the order of
arguments to @node. Insert a carriage return after the comment line.
Leave point after `@node'."
- (interactive)
- (insert "@node \n@comment node-name, next, previous, up\n")
- (forward-line -2)
- (forward-char 6))
+ nil
+ \n "@node " _ \n)
-(defun texinfo-insert-@noindent ()
+(define-skeleton texinfo-insert-@noindent
"Insert the string `@noindent' in a Texinfo buffer."
- (interactive)
- (insert "@noindent\n"))
+ nil
+ \n "@noindent" \n)
-(defun texinfo-insert-@quotation ()
+(define-skeleton texinfo-insert-@quotation
"Insert the string `@quotation' in a Texinfo buffer."
- (interactive)
- (insert "@quotation\n"))
+ \n "@quotation" \n)
-(defun texinfo-insert-@samp (&optional arg)
+(define-skeleton texinfo-insert-@samp
"Insert a `@samp{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "samp" arg))
+ nil
+ "@samp{" _ "}")
-(defun texinfo-insert-@strong (&optional arg)
+(define-skeleton texinfo-insert-@strong
"Insert a `@strong{...}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "strong" arg))
+ nil
+ "@strong{" _ "}")
-(defun texinfo-insert-@table ()
+(define-skeleton texinfo-insert-@table
"Insert the string `@table' in a Texinfo buffer."
- (interactive)
- (insert "@table "))
+ nil
+ \n "@table " _ \n)
-(defun texinfo-insert-@var (&optional arg)
+(define-skeleton texinfo-insert-@var
"Insert a `@var{}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "var" arg))
+ nil
+ "@var{" _ "}")
-(defun texinfo-insert-@uref (&optional arg)
+(define-skeleton texinfo-insert-@uref
"Insert a `@uref{}' command in a Texinfo buffer.
A numeric argument says how many words the braces should surround.
The default is not to surround any existing words with the braces."
- (interactive "P")
- (texinfo-insert-@-with-arg "uref" arg))
+ nil
+ "@uref{" _ "}")
(defalias 'texinfo-insert-@url 'texinfo-insert-@uref)
;;; Texinfo file structure
@@ -1050,5 +1024,4 @@ You are prompted for the job number (use a number shown by a previous
(provide 'texinfo)
-;; arch-tag: 005d7c38-43b9-4b7d-aa1d-aea69bae73e1
;;; texinfo.el ends here
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el
index 7e1ce4ce170..12a3e2a620b 100644
--- a/lisp/textmodes/texnfo-upd.el
+++ b/lisp/textmodes/texnfo-upd.el
@@ -1,7 +1,6 @@
;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
-;; Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1989-1992, 2001-2011 Free Software Foundation, Inc.
;; Author: Robert J. Chassell
;; Maintainer: bug-texinfo@gnu.org
@@ -349,9 +348,7 @@ section titles are often too short to explain a node well."
(when (search-forward texinfo-master-menu-header nil t)
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
- (search-backward "\n@detailmenu"
- (save-excursion (forward-line -3) (point))
- t)
+ (search-backward "\n@detailmenu" (line-beginning-position -2) t)
;; Remove detailed master menu listing
(setq master-menu-p t)
(goto-char (match-beginning 0))
@@ -627,9 +624,7 @@ Single argument, END-OF-MENU, is position limiting search."
(point)
(save-excursion
(re-search-forward "\\(^\\* \\|^@ignore\\|^@end menu\\)" end-of-menu t)
- (forward-line -1)
- (end-of-line) ; go to end of last description line
- (point)))
+ (line-end-position 0))) ; end of last description line
""))
(defun texinfo-menu-end ()
@@ -719,34 +714,32 @@ complements the node name rather than repeats it as a title does."
(let (beginning end node-name title)
(save-excursion
(beginning-of-line)
- (if (search-forward "* " (save-excursion (end-of-line) (point)) t)
+ (if (search-forward "* " (line-end-position) t)
(progn (skip-chars-forward " \t")
(setq beginning (point)))
(error "This is not a line in a menu"))
(cond
;; "Double colon" entry line; menu entry and node name are the same,
- ((search-forward "::" (save-excursion (end-of-line) (point)) t)
+ ((search-forward "::" (line-end-position) t)
(if (looking-at "[ \t]*[^ \t\n]+")
(error "Descriptive text already exists"))
(skip-chars-backward ": \t")
(setq node-name (buffer-substring beginning (point))))
;; "Single colon" entry line; menu entry and node name are different.
- ((search-forward ":" (save-excursion (end-of-line) (point)) t)
+ ((search-forward ":" (line-end-position) t)
(skip-chars-forward " \t")
(setq beginning (point))
;; Menu entry line ends in a period, comma, or tab.
- (if (re-search-forward "[.,\t]"
- (save-excursion (forward-line 1) (point)) t)
+ (if (re-search-forward "[.,\t]" (line-beginning-position 2) t)
(progn
(if (looking-at "[ \t]*[^ \t\n]+")
(error "Descriptive text already exists"))
(skip-chars-backward "., \t")
(setq node-name (buffer-substring beginning (point))))
;; Menu entry line ends in a return.
- (re-search-forward ".*\n"
- (save-excursion (forward-line 1) (point)) t)
+ (re-search-forward ".*\n" (line-beginning-position 2) t)
(skip-chars-backward " \t\n")
(setq node-name (buffer-substring beginning (point)))
(if (= 0 (length node-name))
@@ -904,9 +897,7 @@ section titles are often too short to explain a node well."
(progn
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
- (search-backward "\n@detailmenu"
- (save-excursion (forward-line -3) (point))
- t)
+ (search-backward "\n@detailmenu" (line-beginning-position -2) t)
;; Remove detailed master menu listing
(goto-char (match-beginning 0))
(let ((end-of-detailed-menu-descriptions
@@ -941,9 +932,7 @@ section titles are often too short to explain a node well."
(goto-char (match-beginning 0))
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
- (search-backward "\n@detailmenu"
- (save-excursion (forward-line -3) (point))
- t)
+ (search-backward "\n@detailmenu" (line-beginning-position -2) t)
(insert "\n")
(delete-blank-lines)
(goto-char (point-min))))
@@ -1154,8 +1143,7 @@ Only argument is a string of the general type of section."
(save-excursion
(goto-char (point-min))
(re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t)
- (beginning-of-line)
- (point)))
+ (line-beginning-position)))
(t
(save-excursion
(re-search-backward
@@ -1206,13 +1194,11 @@ The menu will be located just before this position.
First argument is the position of the beginning of the section in
which the menu will be located; second argument is the position of the
end of that region; it limits the search."
-
(save-excursion
(goto-char beginning)
(forward-line 1)
(re-search-forward "^@node" end t)
- (beginning-of-line)
- (point)))
+ (line-beginning-position)))
;;; Updating a node
@@ -1331,7 +1317,7 @@ Point must be at beginning of node line. Does not move point."
Starts from the current position of the cursor, and searches forward
on the line for a comma and if one is found, deletes the rest of the
line, including the comma. Leaves point at beginning of line."
- (let ((eol-point (save-excursion (end-of-line) (point))))
+ (let ((eol-point (line-end-position)))
(if (search-forward "," eol-point t)
(delete-region (1- (point)) eol-point)))
(beginning-of-line))
@@ -1437,8 +1423,7 @@ will be at some level higher in the Texinfo file. The fourth argument
"\\)")
(save-excursion
(goto-char beginning)
- (beginning-of-line)
- (point))
+ (line-beginning-position))
t)
'normal
'no-pointer))
@@ -1453,7 +1438,7 @@ The argument is the kind of section, either `normal' or `no-pointer'."
(end-of-line) ; this handles prev node top case
(re-search-backward ; when point is already
"^@node" ; at the beginning of @node line
- (save-excursion (forward-line -3))
+ (line-beginning-position -2)
t)
(setq name (texinfo-copy-node-name)))
((eq kind 'no-pointer)
@@ -1483,7 +1468,7 @@ towards which the pointer is directed, one of `next', `previous', or `up'."
"Remove extra commas, if any, at end of node line."
(end-of-line)
(skip-chars-backward ", ")
- (delete-region (point) (save-excursion (end-of-line) (point))))
+ (delete-region (point) (line-end-position)))
;;; Updating nodes sequentially
@@ -1647,13 +1632,14 @@ node names in pre-existing `@node' lines that lack names."
(skip-chars-forward " \t")
(setq title (buffer-substring
(point)
- (save-excursion (end-of-line) (point))))))
+ (line-end-position)))))
;; Insert node line if necessary.
(if (re-search-backward
"^@node"
;; Avoid finding previous node line if node lines are close.
(or last-section-position
- (save-excursion (forward-line -2) (point))) t)
+ (line-beginning-position -1))
+ t)
;; @node is present, and point at beginning of that line
(forward-word 1) ; Leave point just after @node.
;; Else @node missing; insert one.
@@ -1675,7 +1661,7 @@ node names in pre-existing `@node' lines that lack names."
(message "Inserted title %s ... " title)))))
;; Go forward beyond current section title.
(re-search-forward texinfo-section-types-regexp
- (save-excursion (forward-line 3) (point)) t)
+ (line-beginning-position 4) t)
(setq last-section-position (point))
(forward-line 1))
@@ -1993,9 +1979,7 @@ chapter."
(point-min)
(save-excursion
(re-search-forward "^@include")
- (beginning-of-line)
- (point)))
-
+ (line-beginning-position)))
;; If found, leave point after word `menu' on the `@menu' line.
(progn
(texinfo-incorporate-descriptions main-menu-list)
@@ -2021,9 +2005,7 @@ chapter."
(goto-char (match-beginning 0))
;; Check if @detailmenu kludge is used;
;; if so, leave point before @detailmenu.
- (search-backward "\n@detailmenu"
- (save-excursion (forward-line -3) (point))
- t)
+ (search-backward "\n@detailmenu" (line-beginning-position -2) t)
;; Remove detailed master menu listing
(let ((end-of-detailed-menu-descriptions
(save-excursion ; beginning of end menu line
@@ -2057,5 +2039,4 @@ chapter."
;; Place `provide' at end of file.
(provide 'texnfo-upd)
-;; arch-tag: d21613a5-c32f-43f4-8af4-bfb1e7455842
;;; texnfo-upd.el ends here
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index bcde482cdd4..3f6ad1faf87 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -1,10 +1,10 @@
;;; text-mode.el --- text mode, and its idiosyncratic commands
-;; Copyright (C) 1985, 1992, 1994, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1992, 1994, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: wp
+;; Package: emacs
;; This file is part of GNU Emacs.
@@ -32,7 +32,7 @@
"Normal hook run when entering Text mode and many related modes."
:type 'hook
:options '(turn-on-auto-fill turn-on-flyspell)
- :group 'data)
+ :group 'wp)
(defvar text-mode-variant nil
"Non-nil if this buffer's major mode is a variant of Text mode.
@@ -181,5 +181,4 @@ The argument NLINES says how many lines to center."
(setq nlines (1+ nlines))
(forward-line -1)))))
-;; arch-tag: a07ccaad-da13-4d7b-9c61-cd04f5926aab
;;; text-mode.el ends here
diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el
index 0f5c0a43a5c..b5af00cc450 100644
--- a/lisp/textmodes/tildify.el
+++ b/lisp/textmodes/tildify.el
@@ -1,7 +1,6 @@
;;; tildify.el --- adding hard spaces into texts
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2011 Free Software Foundation, Inc.
;; Author: Milan Zamazal <pdm@zamazal.org>
;; Version: 4.5
@@ -353,5 +352,4 @@ further questions)."
;; coding: iso-latin-2
;; End:
-;; arch-tag: fc9b05a6-7355-4639-8170-dcf57853ba22
;;; tildify.el ends here
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index c80bd8c1b7a..68b858162df 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -1,7 +1,6 @@
;;; two-column.el --- minor mode for editing of two-column text
-;; Copyright (C) 1992, 1993, 1994, 1995, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1995, 2001-2011 Free Software Foundation, Inc.
;; Author: Daniel Pfeiffer <occitan@esperanto.org>
;; Adapted-By: ESR, Daniel Pfeiffer
@@ -209,19 +208,19 @@
(defcustom 2C-mode-line-format
'("-%*- %15b --" (-3 . "%p") "--%[(" mode-name
minor-mode-alist "%n" mode-line-process ")%]%-")
- "*Value of `mode-line-format' for a buffer in two-column minor mode."
+ "Value of `mode-line-format' for a buffer in two-column minor mode."
:type 'sexp
:group 'two-column)
(defcustom 2C-other-buffer-hook 'text-mode
- "*Hook run in new buffer when it is associated with current one."
+ "Hook run in new buffer when it is associated with current one."
:type 'function
:group 'two-column)
(defcustom 2C-separator ""
- "*A string inserted between the two columns when merging.
+ "A string inserted between the two columns when merging.
This gets set locally by \\[2C-split]."
:type 'string
:group 'two-column)
@@ -230,7 +229,7 @@ This gets set locally by \\[2C-split]."
(defcustom 2C-window-width 40
- "*The width of the first column. (Must be at least `window-min-width')
+ "The width of the first column. (Must be at least `window-min-width')
This value is local for every buffer that sets it."
:type 'integer
:group 'two-column)
@@ -240,7 +239,7 @@ This value is local for every buffer that sets it."
(defcustom 2C-beyond-fill-column 4
- "*Base for calculating `fill-column' for a buffer in two-column minor mode.
+ "Base for calculating `fill-column' for a buffer in two-column minor mode.
The value of `fill-column' becomes `2C-window-width' for this buffer
minus this value."
:type 'integer
@@ -632,5 +631,4 @@ on, this also realigns the two buffers."
(provide 'two-column)
-;; arch-tag: 2021b5ab-d3a4-4a8c-a21c-1936b0f9e6b1
;;; two-column.el ends here
diff --git a/lisp/textmodes/underline.el b/lisp/textmodes/underline.el
index f7507f6d6a5..2adac5a106a 100644
--- a/lisp/textmodes/underline.el
+++ b/lisp/textmodes/underline.el
@@ -1,7 +1,6 @@
;;; underline.el --- insert/remove underlining (done by overstriking) in Emacs
-;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: wp
@@ -61,5 +60,4 @@ which specify the range to operate on."
(provide 'underline)
-;; arch-tag: e7b48582-c3ea-4386-987a-87415f3c372a
;;; underline.el ends here