;;; gnus-art.el --- article mode commands for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+;; Copyright (C) 1996, 97, 98, 1999, 2000, 01, 02, 2004
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
(unless gnus-inhibit-hiding
(save-excursion
(save-restriction
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(case-fold-search t)
(max (1+ (length gnus-sorted-header-list)))
(ignored (when (not gnus-visible-headers)
(not gnus-show-all-headers))
(save-excursion
(save-restriction
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(list gnus-boring-article-headers)
(inhibit-point-motion-hooks t)
elem)
(defun article-normalize-headers ()
"Make all header lines 40 characters long."
(interactive)
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
column)
(save-excursion
(save-restriction
characters to translate to."
(save-excursion
(when (article-goto-body)
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(x (make-string 225 ?x))
(i -1))
(while (< (incf i) (length x))
MAP is an alist where the elements are on the form (\"from\" \"to\")."
(save-excursion
(when (article-goto-body)
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
elem)
(while (setq elem (pop map))
(save-excursion
(interactive)
(save-excursion
(when (article-goto-body)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(while (search-forward "\b" nil t)
(let ((next (char-after))
(previous (char-after (- (point) 2))))
"Fill lines that are wider than the window width."
(interactive)
(save-excursion
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(width (window-width (get-buffer-window (current-buffer)))))
(save-restriction
(article-goto-body)
"Capitalize the first word in each sentence."
(interactive)
(save-excursion
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(paragraph-start "^[\n\^L]"))
(article-goto-body)
(while (not (eobp))
"Remove trailing CRs and then translate remaining CRs into LFs."
(interactive)
(save-excursion
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(goto-char (point-min))
(while (re-search-forward "\r+$" nil t)
(replace-match "" t t))
"Remove all trailing blank lines from the article."
(interactive)
(save-excursion
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(goto-char (point-max))
(delete-region
(point)
or not."
(interactive (list 'force))
(save-excursion
- (let ((buffer-read-only nil) type charset)
+ (let ((inhibit-read-only t) type charset)
(if (gnus-buffer-live-p gnus-original-article-buffer)
(with-current-buffer gnus-original-article-buffer
(setq type
If FORCE, decode the article whether it is marked as base64 not."
(interactive (list 'force))
(save-excursion
- (let ((buffer-read-only nil) type charset)
+ (let ((inhibit-read-only t) type charset)
(if (gnus-buffer-live-p gnus-original-article-buffer)
(with-current-buffer gnus-original-article-buffer
(setq type
(interactive)
(require 'rfc1843)
(save-excursion
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(rfc1843-decode-region (point-min) (point-max)))))
(defun article-wash-html ()
"Format an html article."
(interactive)
(save-excursion
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
charset)
(if (gnus-buffer-live-p gnus-original-article-buffer)
(with-current-buffer gnus-original-article-buffer
(save-excursion
(set-buffer gnus-article-buffer)
(when (article-goto-body)
- (let* ((buffer-read-only nil)
+ (let* ((inhibit-read-only t)
(start (point))
(end (point-max))
(orig (buffer-substring start end))
(unless (gnus-article-check-hidden-text 'signature arg)
(save-excursion
(save-restriction
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(when (gnus-article-narrow-to-signature)
(gnus-article-hide-text-type
(point-min) (point-max) 'signature)))))))
(defun gnus-article-show-hidden-text (type &optional dummy)
"Show all hidden text of type TYPE.
Originally it is hide instead of DUMMY."
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(inhibit-point-motion-hooks t))
(gnus-remove-text-properties-when
'article-type type
(forward-line 1))
(when (and date (not (string= date "")))
(goto-char (point-min))
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
;; Delete any old Date headers.
(while (re-search-forward date-regexp nil t)
(if pos
"Show all hidden text in the article buffer."
(interactive)
(save-excursion
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(gnus-article-unhide-text (point-min) (point-max)))))
(defun article-emphasize (&optional arg)
gnus-article-emphasis-alist)
(error))
gnus-emphasis-alist))
- (buffer-read-only nil)
+ (inhibit-read-only t)
(props (append '(article-type emphasis)
gnus-hidden-properties))
regexp elem beg invisible visible face)
(when (and (boundp 'transient-mark-mode)
transient-mark-mode)
(setq mark-active nil))
- (if (not (setq result (let ((buffer-read-only nil))
+ (if (not (setq result (let ((inhibit-read-only t))
(gnus-request-article-this-buffer
article group))))
;; There is no such article.
(widen)
;; Remove any old next/prev buttons.
(when (gnus-visual-p 'page-marker)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(gnus-remove-text-with-property 'gnus-prev)
(gnus-remove-text-with-property 'gnus-next)))
(when
(match-beginning 0)
(point)))
(when (and (gnus-visual-p 'page-marker)
- (not (= (point-min) 1)))
+ (> (point-min) (save-restriction (widen) (point-min))))
(save-excursion
(goto-char (point-min))
(gnus-insert-prev-page-button)))
(when (and (gnus-visual-p 'page-marker)
- (< (+ (point-max) 2) (buffer-size)))
+ (< (point-max) (save-restriction (widen) (point-max))))
(save-excursion
(goto-char (point-max))
(gnus-insert-next-page-button)))))
(methods (and (stringp article)
gnus-refer-article-method))
result
- (buffer-read-only nil))
+ (inhibit-read-only t))
(if (or (not (listp methods))
(and (symbolp (car methods))
(assq (car methods) nnoo-definition-alist)))
"\C-c\C-w" gnus-article-edit-mode-map)
"f" gnus-article-edit-full-stops))
-(define-derived-mode gnus-article-edit-mode text-mode "Article Edit"
+(define-derived-mode gnus-article-edit-mode message-mode "Article Edit"
"Major mode for editing articles.
This is an extended text-mode.
(gnus-article-edit-exit)
(save-excursion
(set-buffer buf)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(funcall func arg))
;; The cache and backlog have to be flushed somewhat.
(when gnus-keep-backlog
("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 1)
;; This is how URLs _should_ be embedded in text...
("<URL: *\\([^<>]*\\)>" 0 t gnus-button-embedded-url 1)
+ ;; Info manual references.
+ ("(\\(info\\|Info-goto-node\\)[ \n\t]+\"\\(([^)\"\n]+)[^\"\n]+\\)\")"
+ 0 t Info-goto-node 2)
;; Raw URLs.
(,gnus-button-url-regexp 0 t browse-url 0))
"*Alist of regexps matching buttons in article bodies.
Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
REGEXP: is the string matching text around the button,
BUTTON: is the number of the regexp grouping actually matching the button,
-FORM: is a lisp expression which must eval to true for the button to
+FORM: is a Lisp expression which must eval to true for the button to
be added,
CALLBACK: is the function to call when the user push this button, and each
PAR: is a number of a regexp grouping whose text will be passed to CALLBACK.
(set-buffer gnus-article-buffer)
(save-restriction
(let ((alist gnus-header-face-alist)
- (buffer-read-only nil)
+ (inhibit-read-only t)
(case-fold-search t)
(inhibit-point-motion-hooks t)
entry regexp header-face field-face from hpoints fpoints)
(interactive)
(save-excursion
(set-buffer gnus-article-buffer)
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(inhibit-point-motion-hooks t))
(save-restriction
(when (and gnus-signature-face
(interactive (list 'force))
(save-excursion
(set-buffer gnus-article-buffer)
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(inhibit-point-motion-hooks t)
(case-fold-search t)
(alist gnus-button-alist)
(save-excursion
(set-buffer gnus-article-buffer)
(save-restriction
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(inhibit-point-motion-hooks t)
(case-fold-search t)
(alist gnus-header-button-alist)
(defun gnus-signature-toggle (end)
(save-excursion
(set-buffer gnus-article-buffer)
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(inhibit-point-motion-hooks t))
(if (text-property-any end (point-max) 'article-type 'signature)
(gnus-remove-text-properties-when
(define-key gnus-prev-page-map "\r" 'gnus-button-prev-page))
(defun gnus-insert-prev-page-button ()
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(gnus-eval-format
gnus-prev-page-line-format nil
`(gnus-prev t local-map ,gnus-prev-page-map
(select-window win)))
(defun gnus-insert-next-page-button ()
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(gnus-eval-format gnus-next-page-line-format nil
`(gnus-next
t local-map ,gnus-next-page-map
"List of methods used to decode headers.
This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item
-is FUNCTION, FUNCTION will be apply to all newsgroups. If item is a
-\(REGEXP . FUNCTION), FUNCTION will be only apply to these newsgroups
+is FUNCTION, FUNCTION will be applied to all newsgroups. If item is a
+\(REGEXP . FUNCTION), FUNCTION will be only applied to these newsgroups
whose names match REGEXP.
For example: