diff options
Diffstat (limited to 'lisp/textmodes')
-rw-r--r-- | lisp/textmodes/bibtex.el | 123 | ||||
-rw-r--r-- | lisp/textmodes/enriched.el | 4 | ||||
-rw-r--r-- | lisp/textmodes/flyspell.el | 8 | ||||
-rw-r--r-- | lisp/textmodes/org.el | 4 | ||||
-rw-r--r-- | lisp/textmodes/refill.el | 4 | ||||
-rw-r--r-- | lisp/textmodes/table.el | 4 | ||||
-rw-r--r-- | lisp/textmodes/tex-mode.el | 2 |
7 files changed, 82 insertions, 67 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index fc677b3de44..3e5b77d8baa 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1,6 +1,6 @@ ;;; bibtex.el --- BibTeX mode for GNU Emacs -;; Copyright (C) 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2004 +;; Copyright (C) 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Author: Stefan Schoef <schoef@offis.uni-oldenburg.de> @@ -784,41 +784,56 @@ Used by `bibtex-complete-crossref-cleanup' and `bibtex-copy-summary-as-kill'." (function :tag "Personalized function"))) (defcustom bibtex-generate-url-list - '((("url" . ".*:.*")) - ;; Example of a complex setup. - (("journal" . "\\<\\(PR[ABCDEL]?\\|RMP\\)\\>") - "http://link.aps.org/abstract/" - ("journal" ".*" downcase) - "/v" - ("volume" ".*" 0) - "/p" - ("pages" "\\`\\([0-9]+\\)" 1))) + '((("url" . ".*:.*"))) "List of schemes for generating the URL of a BibTeX entry. These schemes are used by `bibtex-url'. -Each scheme is of the form ((FIELD . REGEXP) STEP...). +Each scheme should have one of these forms: -FIELD is a field name as returned by `bibtex-parse-entry'. -REGEXP is matched against the text of FIELD. If the match succeeds, then -this scheme is used. If no STEPs are specified the matched text is used -as the URL, otherwise the URL is built by concatenating the STEPs. - -A STEP can be a string or a list (FIELD REGEXP REPLACE) in which case -the text of FIELD is matched against REGEXP, and is replaced with REPLACE. -REPLACE can be a string, or a number (which selects the corresponding submatch) -or a function called with the field's text as argument and with the -`match-data' properly set. + ((FIELD . REGEXP)) + ((FIELD . REGEXP) STEP...) + ((FIELD . REGEXP) STRING STEP...) -Case is always ignored. Always remove the field delimiters." +FIELD is a field name as returned by `bibtex-parse-entry'. +REGEXP is matched against the text of FIELD. If the match succeeds, +then this scheme is used. If no STRING and STEPs are specified +the matched text is used as the URL, otherwise the URL is built +by evaluating STEPs. If no STRING is specified the STEPs must result +in strings which are concatenated. Otherwise the resulting objects +are passed through `format' using STRING as format control string. + +A STEP is a list (FIELD REGEXP REPLACE). The text of FIELD +is matched against REGEXP, and is replaced with REPLACE. +REPLACE can be a string, or a number (which selects the corresponding +submatch), or a function called with the field's text as argument +and with the `match-data' properly set. + +Case is always ignored. Always remove the field delimiters. + +The following is a complex example, see http://link.aps.org/linkfaq.html. + + (((\"journal\" . \"\\\\=<\\(PR[ABCDEL]?\\|RMP\\)\\\\=>\") + \"http://link.aps.org/abstract/%s/v%s/p%s\" + (\"journal\" \".*\" downcase) + (\"volume\" \".*\" 0) + (\"pages\" \"\\`[A-Z]?[0-9]+\" 0)))" :group 'bibtex :type '(repeat - (list :tag "Scheme" + (cons :tag "Scheme" (cons :tag "Matcher" :extra-offset 4 (string :tag "BibTeX field") (regexp :tag "Regexp")) - (repeat :tag "Steps to generate URL" :inline t - (choice - (string :tag "Literal text") + (choice + (const :tag "Take match as is" nil) + (cons :tag "Formatted" + (string :tag "Format control string") + (repeat :tag "Steps to generate URL" + (list (string :tag "BibTeX field") + (regexp :tag "Regexp") + (choice (string :tag "Replacement") + (integer :tag "Sub-match") + (function :tag "Filter"))))) + (repeat :tag "Concatenated" (list (string :tag "BibTeX field") (regexp :tag "Regexp") (choice (string :tag "Replacement") @@ -2662,11 +2677,10 @@ begins at the beginning of a line. We use this function for font-locking." (let ((lst bibtex-generate-url-list) url) (goto-char start) (while (and (not found) - (setq url (caar lst))) + (setq url (car (pop lst)))) (setq found (and (bibtex-string= field (car url)) (re-search-forward (cdr url) end t) - (>= (match-beginning 0) pnt)) - lst (cdr lst)))) + (>= (match-beginning 0) pnt))))) (goto-char end)) (if found (bibtex-button (match-beginning 0) (match-end 0) 'bibtex-url (match-beginning 0))) @@ -4283,39 +4297,36 @@ The URL is generated using the schemes defined in `bibtex-generate-url-list' ;; Always ignore case, (case-fold-search t) (lst bibtex-generate-url-list) - field url scheme) + field url scheme obj fmt) (while (setq scheme (pop lst)) (when (and (setq field (cdr (assoc-string (caar scheme) fields-alist t))) ;; Always remove field delimiters (progn (setq field (bibtex-remove-delimiters-string field)) (string-match (cdar scheme) field))) - (setq lst nil) - (if (null (cdr scheme)) - (setq url (match-string 0 field))) - (dolist (step (cdr scheme)) - (cond ((stringp step) - (setq url (concat url step))) - ((setq field (cdr (assoc-string (car step) fields-alist t))) - ;; Always remove field delimiters - (setq field (bibtex-remove-delimiters-string field)) - (if (string-match (nth 1 step) field) - (setq field (cond - ((functionp (nth 2 step)) - (funcall (nth 2 step) field)) - ((numberp (nth 2 step)) - (match-string (nth 2 step) field)) - (t - (replace-match (nth 2 step) t nil field)))) - ;; If the scheme is set up correctly, - ;; we should never reach this point - (error "Match failed: %s" field)) - (setq url (concat url field))) - ;; If the scheme is set up correctly, - ;; we should never reach this point - (t (error "Step failed: %s" step)))) - (message "%s" url) - (browse-url url))) + (setq lst nil + scheme (cdr scheme) + url (if (null scheme) (match-string 0 field) + (if (stringp (car scheme)) + (setq fmt (pop scheme))) + (dolist (step scheme) + ;; Always remove field delimiters + (setq field (bibtex-remove-delimiters-string + (cdr (assoc-string (car step) fields-alist t)))) + (if (string-match (nth 1 step) field) + (setq field (cond ((functionp (nth 2 step)) + (funcall (nth 2 step) field)) + ((numberp (nth 2 step)) + (match-string (nth 2 step) field)) + (t + (replace-match (nth 2 step) t nil field)))) + ;; If the scheme is set up correctly, + ;; we should never reach this point + (error "Match failed: %s" field)) + (push field obj)) + (if fmt (apply 'format fmt (nreverse obj)) + (apply 'concat (nreverse obj))))) + (browse-url (message "%s" url)))) (unless url (message "No URL known."))))) diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el index 71bb6cf137d..b1b5abc488f 100644 --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el @@ -1,6 +1,6 @@ ;;; enriched.el --- read and save files in text/enriched format -;; Copyright (c) 1994, 1995, 1996, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (c) 1994, 1995, 1996, 2002, 2004, 2005 Free Software Foundation, Inc. ;; Author: Boris Goldowsky <boris@gnu.org> ;; Keywords: wp, faces @@ -183,7 +183,7 @@ etc/enriched.doc in the Emacs distribution directory. Commands: \\{enriched-mode-map}" - nil " Enriched" nil + :group 'enriched :lighter " Enriched" (cond ((null enriched-mode) ;; Turn mode off (setq buffer-file-format (delq 'text/enriched buffer-file-format)) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index dfa3a7fa692..dbe8b1cfbc6 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -221,10 +221,10 @@ Set this to nil if you don't want a modeline indicator." (defcustom flyspell-large-region 1000 "*The threshold that determines if a region is small. -The `flyspell-region' function is invoked if the region is small, the -word are checked one after the other using regular flyspell check -means. If the region is large, a new Ispell process is spawned to get -speed." +If the region is smaller than this number of characters, +`flyspell-region' checks the words sequentially using regular +flyspell methods. Else, if the region is large, a new Ispell process is +spawned for speed." :group 'flyspell :version "21.1" :type 'number) diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index 86406d37475..06d4e697d55 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el @@ -279,7 +279,7 @@ the following lines anywhere in the buffer: :group 'org-startup :type 'boolean) -(defcustom org-insert-mode-line-in-empty-file t +(defcustom org-insert-mode-line-in-empty-file nil "Non-nil means insert the first line setting Org-mode in empty files. When the function `org-mode' is called interactively in an empty, this normally means that the file name does not automatically trigger Org-mode. @@ -3477,7 +3477,7 @@ date." (defun org-diary-default-entry () "Add a dummy entry to the diary. Needed to avoid empty dates which mess up holiday display." - (add-to-diary-list original-date "Org-mode dummy" "")) + (add-to-diary-list original-date "Org-mode dummy" "" nil)) (defun org-add-file (&optional file) "Add current file to the list of files in variable `org-agenda-files'. diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el index 9979f4a3e27..d5f3b19cc9c 100644 --- a/lisp/textmodes/refill.el +++ b/lisp/textmodes/refill.el @@ -221,7 +221,9 @@ With prefix arg, turn Refill mode on iff arg is positive. When Refill mode is on, the current paragraph will be formatted when changes are made within it. Self-inserting characters only cause refilling if they would cause auto-filling." - nil " Refill" '(("\177" . backward-delete-char-untabify)) + :group 'refill + :lighter " Refill" + :keymap '(("\177" . backward-delete-char-untabify)) ;; Remove old state if necessary (when refill-ignorable-overlay (delete-overlay refill-ignorable-overlay) diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 52a0c8a1deb..a85e968d3ee 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -683,7 +683,9 @@ height." :group 'table) (defface table-cell-face - '((((class color)) + '((((min-colors 88) (class color)) + (:foreground "gray90" :background "blue1")) + (((class color)) (:foreground "gray90" :background "blue")) (t (:bold t))) "*Face used for table cell contents." diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 0c83406318a..1b3f06eb34b 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -573,7 +573,7 @@ An alternative value is \" . \", if you use a font with a narrow period." 2 '(tex-font-lock-append-prop 'italic) 'append) ;; This is separate from the previous one because of cases like ;; {\em foo {\bf bar} bla} where both match. - (list (concat "\\\\\\(bf\\)\\>" args) + (list (concat "\\\\\\(bf\\(series\\)?\\)\\>" args) 2 '(tex-font-lock-append-prop 'bold) 'append))))) "Gaudy expressions to highlight in TeX modes.") |