diff options
| author | Stefan Monnier | 2015-04-10 00:11:04 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-04-10 00:11:04 -0400 |
| commit | d58759a99ad07d31724f073286c05205cdc245b2 (patch) | |
| tree | 4cdb2fb6a8e686eb7156165bbfb882e7bb2bf8ef | |
| parent | 3a5742a8d4a61b3d4bbfeb03de8e634282aa6027 (diff) | |
| download | emacs-d58759a99ad07d31724f073286c05205cdc245b2.tar.gz emacs-d58759a99ad07d31724f073286c05205cdc245b2.zip | |
* lisp/gnus/gnus-art.el (gnus-hidden-properties): Simplify.
(gnus-article-hide-text, gnus-article-unhide-text)
(gnus-article-unhide-text-type): Remove special handling of
`intangible' since that property is not used any more.
(gnus-article-treat-body-boundary): Use gnus-hidden-properties.
| -rw-r--r-- | lisp/gnus/gnus-art.el | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 5ec1268aee7..b238d65c207 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -255,12 +255,10 @@ This can also be a list of the above values." | |||
| 255 | :group 'gnus-article-signature) | 255 | :group 'gnus-article-signature) |
| 256 | 256 | ||
| 257 | (defcustom gnus-hidden-properties | 257 | (defcustom gnus-hidden-properties |
| 258 | (if (featurep 'xemacs) | 258 | ;; We use to have `intangible' here as well, but Emacs's command loop moves |
| 259 | ;; `intangible' is evil, but I keep it here in case it's useful. | 259 | ;; point out of invisible text anyway, so `intangible' is clearly not |
| 260 | '(invisible t intangible t) | 260 | ;; needed there. And XEmacs doesn't handle `intangible' anyway. |
| 261 | ;; Emacs's command loop moves point out of invisible text anyway, so | 261 | '(invisible t) |
| 262 | ;; `intangible' is clearly not needed there. | ||
| 263 | '(invisible t)) | ||
| 264 | "Property list to use for hiding text." | 262 | "Property list to use for hiding text." |
| 265 | :type 'sexp | 263 | :type 'sexp |
| 266 | :group 'gnus-article-hiding) | 264 | :group 'gnus-article-hiding) |
| @@ -1772,19 +1770,12 @@ Initialized from `text-mode-syntax-table.") | |||
| 1772 | (re-search-forward (concat "^\\(" header "\\):") nil t)) | 1770 | (re-search-forward (concat "^\\(" header "\\):") nil t)) |
| 1773 | 1771 | ||
| 1774 | (defsubst gnus-article-hide-text (b e props) | 1772 | (defsubst gnus-article-hide-text (b e props) |
| 1775 | "Set text PROPS on the B to E region, extending `intangible' 1 past B." | 1773 | "Set text PROPS on the B to E region." |
| 1776 | (gnus-add-text-properties-when 'article-type nil b e props) | 1774 | (gnus-add-text-properties-when 'article-type nil b e props)) |
| 1777 | (when (memq 'intangible props) | ||
| 1778 | (put-text-property | ||
| 1779 | (max (1- b) (point-min)) | ||
| 1780 | b 'intangible (cddr (memq 'intangible props))))) | ||
| 1781 | 1775 | ||
| 1782 | (defsubst gnus-article-unhide-text (b e) | 1776 | (defsubst gnus-article-unhide-text (b e) |
| 1783 | "Remove hidden text properties from region between B and E." | 1777 | "Remove hidden text properties from region between B and E." |
| 1784 | (remove-text-properties b e gnus-hidden-properties) | 1778 | (remove-text-properties b e gnus-hidden-properties)) |
| 1785 | (when (memq 'intangible gnus-hidden-properties) | ||
| 1786 | (put-text-property (max (1- b) (point-min)) | ||
| 1787 | b 'intangible nil))) | ||
| 1788 | 1779 | ||
| 1789 | (defun gnus-article-hide-text-type (b e type) | 1780 | (defun gnus-article-hide-text-type (b e type) |
| 1790 | "Hide text of TYPE between B and E." | 1781 | "Hide text of TYPE between B and E." |
| @@ -1796,10 +1787,7 @@ Initialized from `text-mode-syntax-table.") | |||
| 1796 | "Unhide text of TYPE between B and E." | 1787 | "Unhide text of TYPE between B and E." |
| 1797 | (gnus-delete-wash-type type) | 1788 | (gnus-delete-wash-type type) |
| 1798 | (remove-text-properties | 1789 | (remove-text-properties |
| 1799 | b e (cons 'article-type (cons type gnus-hidden-properties))) | 1790 | b e (cons 'article-type (cons type gnus-hidden-properties)))) |
| 1800 | (when (memq 'intangible gnus-hidden-properties) | ||
| 1801 | (put-text-property (max (1- b) (point-min)) | ||
| 1802 | b 'intangible nil))) | ||
| 1803 | 1791 | ||
| 1804 | (defun gnus-article-delete-text-of-type (type) | 1792 | (defun gnus-article-delete-text-of-type (type) |
| 1805 | "Delete text of TYPE in the current buffer." | 1793 | "Delete text of TYPE in the current buffer." |
| @@ -2329,7 +2317,7 @@ long lines if and only if arg is positive." | |||
| 2329 | (goto-char (point-max)) | 2317 | (goto-char (point-max)) |
| 2330 | (let ((start (point))) | 2318 | (let ((start (point))) |
| 2331 | (insert "X-Boundary: ") | 2319 | (insert "X-Boundary: ") |
| 2332 | (gnus-add-text-properties start (point) '(invisible t intangible t)) | 2320 | (gnus-add-text-properties start (point) gnus-hidden-properties) |
| 2333 | (insert (let (str (max (window-width))) | 2321 | (insert (let (str (max (window-width))) |
| 2334 | (if (featurep 'xemacs) | 2322 | (if (featurep 'xemacs) |
| 2335 | (setq max (1- max))) | 2323 | (setq max (1- max))) |