1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00
emacs/lisp/gnus/gnus-spec.el

667 lines
21 KiB
EmacsLisp
Raw Normal View History

* lisp/gnus: Use lexical-binding in all the files * lisp/gnus/gnus-group.el (features): Use `dlet`. (gnus-tmp-level, gnus-tmp-marked, gnus-tmp-group): Declare vars. (gnus-group-insert-group-line): Bind dynbound vars via `let` rather than as formal args. Bind `number` as dynbound. (gnus-visual, gnus-score-find-score-files-function) (gnus-home-score-file, gnus-apply-kill-hook) (gnus-summary-expunge-below): Declare vars. (gnus-group-restart, gnus-group-list-plus): Fix `interactive` spec since the arg is unused. * lisp/gnus/mail-source.el (mail-source-bind, mail-source-bind-common): Use `dlet` and suppress the warnings about the non-prefixed dynbound vars. (mail-source-set-1): Remove unused var `auth-info`. (mail-source-call-script): Remove unused var `background`. (mail-source-fetch-pop, mail-source-check-pop): Bind pop3 vars with `dlet`. * lisp/gnus/gnus-int.el (mail-source-plugged, gnus-inhibit-demon): Declare vars. (gnus-server-opened, gnus-status-message) (gnus-open-server, gnus-close-server, gnus-request-list) (gnus-finish-retrieve-group-infos, gnus-retrieve-group-data-early) (gnus-request-list-newsgroups, gnus-request-newgroups) (gnus-request-regenerate, gnus-request-compact, gnus-request-group) (gnus-retrieve-groups, gnus-request-post, gnus-request-expunge-group) (gnus-request-scan, gnus-request-update-info, gnus-request-marks) (gnus-request-accept-article, gnus-request-create-group) (gnus-asynchronous-p, gnus-remove-denial): Bind `gnus-command-method` via `let` rather than as formal args. * lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line): Pass documented vars to eval for `gnus-topic-line-format-spec`. * lisp/gnus/message.el (message-yank-original): Use `cl-progv` rather than `eval` to bind the vars from `message-cite-style`. * lisp/gnus/mml.el (mml-parse-1): Use `apply` instead of `eval`. (gnus-newsgroup-name, gnus-displaying-mime, gnus-newsgroup-name) (gnus-article-prepare-hook, gnus-newsgroup-charset) (gnus-original-article-buffer, gnus-message-buffer) (message-this-is-news, message-this-is-mail): Declare vars. * lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): Remove unused var `cite-marks`. * lisp/gnus/gnus-art.el (ansi-color-context-region): Declare var. (gnus-mime-display-attachment-buttons-in-header): Move declaration before first use. (gnus-mime-display-alternative): Remove unused var `from`. * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-list): Remove unused var `start` `end`. * lisp/gnus/gnus-cache.el (gnus-article-decode-hook) (nnml-generate-active-function): Declare var. * lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Remove unused var `keywords`. * lisp/gnus/gnus-cloud.el (gnus-cloud-encode-data): Remove unused var `cipher`. (gnus-cloud-ensure-cloud-group): Remove unused var `method`. * lisp/gnus/gnus-delay.el (gnus-delay-article): Remove unused var `days`. * lisp/gnus/gnus-html.el (gnus-html-wash-images): Remove unused vars `tag`, `string`, and `images`. (gnus-html-wash-tags): Remove unused vars `string` and `images`. * lisp/gnus/gnus-msg.el (gnus-msg-mail): Remove unused var `group-name`. (gnus-group-mail, gnus-group-news, gnus-summary-mail-other-window) (gnus-summary-news-other-window): Remove unused vars `group` and `buffer`. (gnus-configure-posting-styles): Remove unused vars `style` and `attribute`. * lisp/gnus/gnus-picon.el (gnus-picon-find-face): Remove unused vars `database`, `directory`, and `instance`. (gnus-picon-transform-newsgroups): Remove unused var `point`. * lisp/gnus/gnus-range.el (gnus-range-difference): Remove unused var `safe`. * lisp/gnus/gnus-score.el (gnus-score-load-file): Remove unused var `score-fn`. * lisp/gnus/gnus-sum.el (message-options-set-recipient): Declare var. * lisp/gnus/gnus-undo.el (gnus-undo): Fix docstring lie. * lisp/gnus/gnus-util.el (print-string-length) (iswitchb-make-buflist-hook): Declare vars. (gnus-emacs-version): Remove unused var `codename`. (gnus-rename-file): Remove unused vars `old-name` and `new-name`. * lisp/gnus/gnus-uu.el (gnus-uu-yenc-article): Remove unused var `start-char`. (gnus-asynchronous): Declare var. * lisp/gnus/mm-partial.el (gnus-displaying-mime): Declare var. (mm-inline-partial): Remove unused var `buffer`. * lisp/gnus/mm-view.el (w3m-force-redisplay, w3m-safe-url-regexp) (gnus-displaying-mime, gnus-original-article-buffer) (gnus-article-prepare-hook): Declare vars. * lisp/gnus/mml-smime.el (mml-smime-epg-encrypt): Remove unused var `boundary`. (mml-smime-epg-verify): Remove unused vars `plain` and `signature-file`. * lisp/gnus/mml1991.el (pgg-text-mode): Declare var. * lisp/gnus/mml2015.el (pgg-text-mode): Declare var. (mml2015-pgg-decrypt): Remove unused var `result`. (mml2015-epg-key-image-to-string): Remove unused var `error`. (mml2015-epg-decrypt): Remove unused var `result`. (mml2015-epg-verify): Remove unused vars `plain` and `signature-file`. * lisp/gnus/nnbabyl.el (nnml-current-directory): Declare var. * lisp/gnus/nndiary.el (nndiary-files): Move declaration before first use. * lisp/gnus/nnfolder.el (nnfolder-request-accept-article): Remove unused var `buf`. * lisp/gnus/nnmail.el (nnmail-parse-active): Remove unused var `err`. * lisp/gnus/nnmairix.el (nnmairix-request-group): Remove unused var `args`. (nnmairix-request-create-group): Remove unused var `info`. (nnmairix-request-list): Remove unused var `folder`. (nnmairix-request-set-mark): Remove unused var `propto`. (nnmairix-request-set-mark): Remove unused vars `number` and `method`. (nnmairix-close-group): Remove unused var `method`. (nnmairix-create-search-group-from-message): Remove unused var `cq`. (nnmairix-create-server-and-default-group): Remove unused var `create`. (nnmairix-purge-old-groups): Remove unused var `folder`. (nnmairix-remove-tick-mark-original-article, nnmairix-get-valid-servers): Remove unused var `cur`. (nnmairix-replace-group-and-numbers): Remove unused var `header`. (nnmairix-goto-original-article): Remove unused var `rval`. (nnmairix-widget-create-query): Remove unused var `allwidgets`. * lisp/gnus/nnmbox.el (nnml-current-directory): Declare var. * lisp/gnus/nnmh.el (nnmh-toplev): Move declaration before first use. (nnmh-request-list-1): Remove unused var `rdir`. * lisp/gnus/nnml.el (nnml-generate-nov-file): Remove unused var `file`. * lisp/gnus/nnrss.el (nnrss-request-article): Remove unused var `post`. (nnrss-request-article): Remove unused var `fn`. (nnrss-check-group): Remove unused var `rdf-ns`. * lisp/gnus/nnweb.el (nnweb-request-article): Remove unused var `active`. (nnweb-google-parse-1): Remove unused var `Score`. * lisp/gnus/spam-stat.el (spam-stat-error-holder): Remove var. (spam-stat-buffer-words-with-scores): Remove unused var `word`. (spam-stat-score-buffer): Remove unused var `spam-stat-error-holder`. (spam-stat-split-fancy): Use `err` instead of `spam-stat-error-holder`. * lisp/gnus/spam-wash.el (spam-wash): Remove unused var `handle`. * lisp/gnus/spam.el (spam-copy-or-move-routine): Remove unused vars `article` and `mark`. (spam-register-routine): Remove unused var `article`. (spam-log-undo-registration): Remove unused var `found`. (spam-ifile-register-with-ifile): Remove unused var `parameters`. (spam-check-stat): Remove unused vars `category` and `return`. (spam-parse-list): Remove unused var `found`. (spam-filelist-register-routine): Remove unused var `from`.
2021-01-30 23:44:00 +00:00
;;; gnus-spec.el --- format spec functions for Gnus -*- lexical-binding: t; -*-
2005-08-06 19:51:42 +00:00
2024-01-02 01:47:10 +00:00
;; Copyright (C) 1996-2024 Free Software Foundation, Inc.
1997-04-16 22:13:18 +00:00
1999-02-20 14:05:57 +00:00
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
1997-04-16 22:13:18 +00:00
;; Keywords: news
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
1997-04-16 22:13:18 +00:00
;; 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.
1997-04-16 22:13:18 +00:00
;; 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
1997-04-16 22:13:18 +00:00
;; 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 <https://www.gnu.org/licenses/>.
1997-04-16 22:13:18 +00:00
;;; Commentary:
;;; Code:
gnus: replace cl with cl-lib * lisp/gnus/gnus-agent.el, lisp/gnus/gnus-art.el: * lisp/gnus/gnus-async.el, lisp/gnus/gnus-cache.el: * lisp/gnus/gnus-demon.el, lisp/gnus/gnus-group.el: * lisp/gnus/gnus-icalendar.el, lisp/gnus/gnus-logic.el: * lisp/gnus/gnus-msg.el, lisp/gnus/gnus-picon.el: * lisp/gnus/gnus-registry.el, lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-score.el, lisp/gnus/gnus-spec.el: * lisp/gnus/gnus-srvr.el, lisp/gnus/gnus-start.el: * lisp/gnus/gnus-sum.el, lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el, lisp/gnus/gnus-uu.el, lisp/gnus/gnus-win.el: * lisp/gnus/mail-source.el, lisp/gnus/mm-decode.el: * lisp/gnus/mm-encode.el, lisp/gnus/mm-url.el, lisp/gnus/mm-view.el: * lisp/gnus/mml-smime.el, lisp/gnus/mml.el, lisp/gnus/mml2015.el: * lisp/gnus/nnbabyl.el, lisp/gnus/nndoc.el, lisp/gnus/nneething.el: * lisp/gnus/nnheader.el, lisp/gnus/nnimap.el, lisp/gnus/nnmail.el: * lisp/gnus/nnmaildir.el, lisp/gnus/nnoo.el, lisp/gnus/nnrss.el: * lisp/gnus/nnspool.el, lisp/gnus/nntp.el, lisp/gnus/nnvirtual.el: * lisp/gnus/nnweb.el, lisp/gnus/spam.el: Replace cl with cl-lib. * lisp/gnus/canlock.el, lisp/gnus/gnus-bcklg.el: * lisp/gnus/gnus-cite.el, lisp/gnus/gnus-cloud.el: * lisp/gnus/gnus-draft.el, lisp/gnus/gnus-dup.el: * lisp/gnus/gnus-fun.el, lisp/gnus/gnus-html.el: * lisp/gnus/gnus-int.el, lisp/gnus/gnus-kill.el, lisp/gnus/gnus-ml.el: * lisp/gnus/gnus-mlspl.el, lisp/gnus/gnus-range.el: * lisp/gnus/gnus-undo.el, lisp/gnus/gnus-vm.el: * lisp/gnus/mm-partial.el, lisp/gnus/mm-uu.el, lisp/gnus/mml1991.el: * lisp/gnus/nnagent.el, lisp/gnus/nndiary.el, lisp/gnus/nndir.el: * lisp/gnus/nndraft.el, lisp/gnus/nnfolder.el, lisp/gnus/nngateway.el: * lisp/gnus/nnmairix.el, lisp/gnus/nnmbox.el, lisp/gnus/nnmh.el: * lisp/gnus/nnml.el, lisp/gnus/score-mode.el, lisp/gnus/smiley.el: No need for cl.
2018-03-23 20:13:09 +00:00
(eval-when-compile (require 'cl-lib))
(defvar gnus-newsrc-file-version)
1997-08-25 04:40:29 +00:00
1997-04-16 22:13:18 +00:00
(require 'gnus)
;;; Internal variables.
(defvar gnus-summary-mark-positions nil)
(defvar gnus-group-mark-positions nil)
(defvar gnus-group-indentation "")
;; Format specs. The chunks below are the machine-generated forms
2011-12-19 06:21:24 +00:00
;; that are to be evalled as the result of the default format strings.
1997-04-16 22:13:18 +00:00
;; We write them in here to get them byte-compiled. That way the
;; default actions will be quite fast, while still retaining the full
;; flexibility of the user-defined format specs.
;; First we have lots of dummy defvars to let the compiler know these
;; are really dynamic variables.
(defvar gnus-tmp-unread)
(defvar gnus-tmp-replied)
(defvar gnus-tmp-score-char)
(defvar gnus-tmp-indentation)
(defvar gnus-tmp-opening-bracket)
(defvar gnus-tmp-lines)
(defvar gnus-tmp-name)
(defvar gnus-tmp-closing-bracket)
(defvar gnus-tmp-subject-or-nil)
(defvar gnus-tmp-subject)
(defvar gnus-tmp-marked)
(defvar gnus-tmp-marked-mark)
(defvar gnus-tmp-subscribed)
(defvar gnus-tmp-process-marked)
(defvar gnus-tmp-number-of-unread)
(defvar gnus-tmp-group-name)
(defvar gnus-tmp-group)
(defvar gnus-tmp-article-number)
(defvar gnus-tmp-unread-and-unselected)
(defvar gnus-tmp-news-method)
(defvar gnus-tmp-news-server)
(defvar gnus-mouse-face)
(defvar gnus-tmp-header)
(defvar gnus-tmp-from)
1997-04-16 22:13:18 +00:00
(declare-function gnus-summary-from-or-to-or-newsgroups "gnus-sum"
(header gnus-tmp-from))
(defmacro gnus-lrm-string-p (string)
;; LRM, RLM, PDF characters as integers to avoid breaking Emacs
;; 23.
`(memq (aref ,string (1- (length ,string))) '(8206 8207 8236)))
(defvar gnus-lrm-string (if (ignore-errors (string 8206))
(propertize (string 8206) 'invisible t)
""))
Merge changes made in Gnus master ever since feature freeze ::::::::::::::::: ::: doc/misc/ ::: ::::::::::::::::: 2012-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.texi (POP before SMTP): POP-before-SMTP works with all sending methods, so don't mention smtpmail here. 2012-05-04 Wolfgang Jenkner <wjenkner@inode.at> * gnus.texi (Picons): Document gnus-picon-properties. 2012-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.texi: Remove mention of compilation, as that's no longer supported. 2012-03-14 Christopher Schmidt <christopher@ch.ristopher.com> * gnus.texi (Archived Messages): Mention gnus-gcc-pre-body-encode-hook and gnus-gcc-post-body-encode-hook. 2012-02-16 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi (Various Summary Stuff): Remove mention of `gnus-propagate-marks'. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi: Remove mentions of nnml/nnfolder/nntp backend marks, which no longer exist. 2012-02-08 Katsumi Yamaoka <yamaoka@jpl.org> * gnus.texi (Archived Messages): Document gnus-gcc-self-resent-messages. 2012-02-06 Lars Ingebrigtsen <larsi@gnus.org> * message.texi (Mail Variables): Mention the optional user parameter for X-Message-SMTP-Method. 2012-02-02 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi (Posting Styles): Mention X-Message-SMTP-Method. * message.texi (Mail Variables): Document X-Message-SMTP-Method. 2012-01-31 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi (Key Index): Change encoding to utf-8. :::::::::::::::::: ::: lisp/gnus/ ::: :::::::::::::::::: 2012-06-26 Katsumi Yamaoka <yamaoka@jpl.org> * mm-decode.el: Add coding cookie for a soft hyphen that mm-shr uses. 2012-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus-art.el (gnus-article-read-summary-keys): Protect against the key being bound to a lambda form. 2012-05-04 Wolfgang Jenkner <wjenkner@inode.at> * gnus-picon.el (gnus-picon-properties): New defcustom. (gnus-picon-create-glyph): Use it. 2012-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * shr.el: Add a iso-8859-1 cookie to make stuff work under other locales. * mm-decode.el (mm-display-part): Dissect archives when hitting `RET' on a handle. * gnus-sum.el (gnus-summary-limit-to-author): Use the current From address as the default. * nnfolder.el (nnfolder-save-buffer): Delete old versions silently. It makes no sense to query the user about internal files. * gnus-spec.el: Remove all the byte-compilation stuff, since benchmarking shows that it doesn't help when entering large summary buffers. * gnus-util.el (gnus-byte-code): Remove. * gnus-spec.el (gnus-update-format-specifications): Remove outdated grouplens stuff. 2012-06-07 Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk> * message.el (message-buffers): Return all buffers derived from Message to make `gnus-dired-attach' work with mu4e. 2012-05-28 Daiki Ueno <ueno@unixuser.org> * mm-decode.el (mm-inhibit-auto-detect-attachment): New variable. (mm-dissect-singlepart): Don't guess the MIME type of application/octet-stream parts if mm-inhibit-auto-detect-attachment is set. (mm-dissect-multipart): Bind mm-inhibit-auto-detect-attachment if the toplevel MIME type is multipart/encrypted. 2011-12-02 Wolfgang Jenkner <wjenkner@inode.at> * gnus-agent.el (gnus-agent-save-active): Deal with the "groups" format. In particular, add an optional argument and a docstring. * gnus-start.el (gnus-groups-to-gnus-format): Use it. * nntp.el (nntp-finish-retrieve-group-infos): Make `nntp-server-buffer' current before calling `gnus-groups-to-gnus-format'. Note that this was already the case for `gnus-active-to-gnus-format'. 2012-04-25 Katsumi Yamaoka <yamaoka@jpl.org> * pop3.el (pop3-wait-for-messages): Fix retrieved data size calculation. 2012-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org> * mm-decode.el (mm-dissect-buffer): Doc fix. * gnus-sum.el (gnus-handle-ephemeral-exit): Avoid creating the group buffer if it doesn't exist. * gnus-group.el (gnus-group-read-ephemeral-group): If no quit-config is given, mark the group as ephemeral with the current window conf. * gnus-sum.el (gnus-set-global-variables): Don't assume that the group buffer exists, which it doesn't if we haven't started Gnus. (gnus-summary-exit): Allow quitting when we don't have a group buffer. 2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * mml.el (mml-generate-mime): Allow specifying what the top-level part type is. * gnus-sum.el (gnus-auto-center-summary): `scroll-margin' isn't defined on XEmacs. 2012-04-10 Philipp Haselwarter <philipp.haselwarter@gmx.de> (tiny change) * gnus-sum.el (gnus-auto-center-summary): Set default to respect `scroll-margin'. 2012-04-10 Elias Oltmanns <eo@nebensachen.de> (tiny change) * gnus-cite.el (gnus-dissect-cited-text): A single line without citation prefix within a block of cited text should be considered part of that block *only* if it is a blank line. 2012-04-02 Katsumi Yamaoka <yamaoka@jpl.org> * shr.el (shr-find-fill-point): Remove unused code; don't break a line before kinsoku-bol characters nor within kinsoku-eol characters. 2012-03-27 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-sync.el (gnus-topic-alist, gnus-group-topic) (gnus-topic-create-topic, gnus-topic-enter-dribble): Silence compiler. (gnus-sync-read): Use mapc instead of mapcar. * mm-archive.el: Require mm-decode for some macros. (gnus-recursive-directory-files, mailcap-extension-to-mime): Silence the byte compiler. (mm-archive-decoders): New function that returns the value of the mm-archive-decoders variable. * mm-decode.el: Don't require mm-archive; autoload mm-archive functions instead. (mm-dissect-singlepart): Use the function mm-archive-decoders. * nnmail.el (mail-send-and-exit): Silence the byte compiler. 2012-03-12 Peter Munster <pmrb@free.fr> * gnus-demon.el (gnus-demon-timers): Now a plist (function -> timer). (gnus-demon-cancel): Ditto. (gnus-demon-run-callback): When function cannot be called due to low idleness, call it when idleness reaches the expected value, instead of waiting another timer period. (gnus-demon-init): Add `time' to arguments of call-back. 2012-03-22 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.el: Register gnus-registry functions. * gnus-registry.el (gnus-try-warping-via-registry): Moved here and indent. * gnus-int.el (gnus-warp-to-article): Check whether the registry is enabled before warping. 2012-03-22 Dave Abrahams <dave@boostpro.com> * gnus-sum.el (gnus-summary-insert-subject): Record information in the registry about each article retrieved. * gnus-int.el (gnus-select-group-with-message-id): New function. (gnus-try-warping-via-registry): Ditto. (gnus-warp-to-article): Fall back on the registry. 2012-03-22 Lars Magne Ingebrigtsen <larsi@gnus.org> * nnimap.el (nnimap-fetch-partial-articles): Minor doc string fixup. 2012-03-22 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-msg.el (gnus-summary-resend-message-insert-gcc): Assume that gnus-gcc-self-resent-messages may be a group parameter. (gnus-summary-resend-message): Don't encode encoded words in header when Gcc'ing resent message. 2012-03-19 Lars Magne Ingebrigtsen <larsi@gnus.org> * shr.el (shr-insert): Treat non-breaking space just like normal space. This seems to produce more pleasing results. (shr-insert): Only insert a blank line if we're starting from an image. (shr-tag-br): Allow <br> to end lines or to make a single blank line. (shr-ensure-paragraph): Consider lines with white space to be blank. 2012-03-14 Christopher Schmidt <christopher@ch.ristopher.com> * gnus-msg.el (gnus-inews-do-gcc): Add gnus-gcc-pre-body-encode-hook and gnus-gcc-post-body-encode-hook. 2012-02-16 Lars Ingebrigtsen <larsi@gnus.org> * mm-decode.el (mm-dissect-singlepart): Guess what the type of application/octet-stream parts really is. * gnus-sum.el (gnus-propagate-marks): Remove. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * nntp.el (nntp-coding-system-for-read): Remove. (nntp-coding-system-for-write): Ditto. (nntp-open-connection): Just use `binary' directly. 2012-02-14 Teodor Zlatanov <tzz@lifelogs.com> * registry.el (registry-usage-test, registry-persistence-test): Move to tests/gnustest-registry.el. (registry-make-testable-db, registry-match-test) (registry-instantiation-test): Move to tests/gnustest-registry.el. * gnus-registry.el (gnus-registry-misc-test) (gnus-registry-usage-test): Move to tests/gnustest-registry.el. * tests/gnustest-registry.el: New file with the registry and gnus-registry ERT tests. 2012-02-13 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-msg.el (gnus-summary-resend-message): Make gnus-summary-resend-message-insert-gcc be last item in message-header-setup-hook. 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org> * nnfolder.el (nnfolder-marks-directory, nnfolder-marks-is-evil) (nnfolder-marks, nnfolder-marks-file-suffix) (nnfolder-marks-modtime): Remove. (nnfolder-open-server): Don't use marks. (nnfolder-request-delete-group): Ditto. (nnfolder-request-rename-group): Ditto. (nnfolder-request-set-mark, nnfolder-request-marks) (nnfolder-group-marks-pathname, nnfolder-marks-changed-p) (nnfolder-save-marks, nnfolder-open-marks): Remove. * nnml.el (nnml-marks-is-evil, nnml-marks-file-name, nnml-marks) (nnml-marks-modtime): Remove. (nnml-request-delete-group): Don't use marks. (nnml-request-rename-group): Ditto. (nnml-request-set-mark, nnml-request-marks, nnml-marks-changed-p) (nnml-save-marks, nnml-open-marks): Remove. * nntp.el (nntp-marks-is-evil, nntp-marks-file-name, nntp-marks) (nntp-marks-modtime, nntp-marks-directory, nntp-request-set-mark) (nntp-request-marks, nntp-marks-directory, nntp-marks-changed-p) (nntp-save-marks, nntp-open-marks, nntp-possibly-create-directory) (nntp-server-to-method-cache): Remove. * shr.el (shr-rescale-image): Fix wrong merge. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * shr.el (shr-remove-trailing-whitespace): Really delete the padding on too-wide lines. 2012-02-09 Lars Ingebrigtsen <larsi@gnus.org> * mm-archive.el (mm-archive-dissect-and-inline): New function. (mm-archive-dissect-and-inline): Fix up the undisplayer. * mm-decode.el (mm-display-external): Output the text from the command in the buffer after the command finished. This makes text-based commands behave better. 2012-02-07 Lars Ingebrigtsen <larsi@gnus.org> * message.el (smtpmail-smtp-user): Silence compiler warning. 2012-02-06 Lars Ingebrigtsen <larsi@gnus.org> * message.el (message-multi-smtp-send-mail): Also allow specifying the SMTP user name. 2012-02-06 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-sum.el (gnus-summary-article-map): Fix typo. 2012-02-02 Lars Ingebrigtsen <larsi@gnus.org> * message.el (message-multi-smtp-send-mail): New function. (message-multi-smtp-send-mail): Respect the X-Message-SMTP-Method header to implement multi-SMTP functionality. * gnus-agent.el (gnus-agent-send-mail-function): Removed. (gnus-agentize): Don't set it. (gnus-agent-send-mail): Don't use it. * gnus-sum.el (gnus-summary-widget-backward): New function and keystroke. * shr.el (shr-put-image): Remove underlines from sliced images. (shr-zoom-image): Compute the region to be replaced more correctly. 2012-02-02 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-msg.el (gnus-gcc-self-resent-messages): New user option. (gnus-summary-resend-message-insert-gcc): New function. (gnus-summary-resend-message): Modify message-header-setup-hook and message-sent-hook to make it work for Gcc. (gnus-inews-do-gcc): Update the number of unread articles of groups that messages are Gcc'd to. * message.el (message-resend): Run message-sent-hook to do Gcc. 2012-02-01 Lars Ingebrigtsen <larsi@gnus.org> * gnus-registry.el (gnus-registry-fixup-registry): Move the message to a higher level to silence compilation. * gnus-art.el (gnus-shr-put-image): Take and pass on a `flags' parameter to allow controlling the scaling. * shr.el (shr-zoom-image): New command and keystroke. (shr-put-image): Take a `size' flag to say how to scale the image. * mm-archive.el (mm-dissect-archive): Use it to get all file names. Use recursive deletion. (mm-dissect-archive): Add support for zip files. * gnus-util.el (gnus-recursive-directory-files): New function. * mm-archive.el (mm-archive-list-files): Inline text and image parts. (mm-archive-decoders): Add tgz support. * mm-decode.el (mm-shr): Make sure that the HTML ends with a newline. Otherwise inserting text into the Gnus buffer can look odd. * gnus-art.el (gnus-mime-inline-part): Slight clean-up. * mm-archive.el (mm-archive-decoders): Add support for tar. * gnus.el (gnus-logo-color-alist): Change the colours for Ma Gnus. * nnmail.el (nnmail-extra-headers): Add Cc to the default. 2012-01-31 Lars Ingebrigtsen <larsi@gnus.org> * mm-decode.el (mm-dissect-singlepart): Check that the decoder exists. * mm-archive.el: New file. * mm-decode.el (mm-dissect-singlepart): Use it to decode ms-tnef files. * mm-util.el (mm-find-buffer-file-coding-system): Comment fix. * message.el (message-goto-*): Make all the `message-goto-*' commands push the mark before moving point. This makes it easier to go back to where you came from after editing whatever you jumped to. 2012-01-07 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el (gnus-sync-newsrc-groups): Quote normally. (gnus-sync-lesync-pre-save-group-entry): Remove invalid invlists. (gnus-sync-lesync-normalize-group-entry): Ignore a few more keys. 2011-11-09 Teodor Zlatanov <tzz@lifelogs.com> * spam.el: Move BBDB autoloads. (spam-exists-in-BBDB-p): New function to do the BBDB search directly in BBDB 2 and 3. (spam-check-BBDB): Use it. (spam-enter-ham-BBDB): Use it. 2011-10-31 Peter Munster <pmrb@free.fr> (tiny change) * gnus-group.el (gnus-group-get-new-news): New parameter `one-level' for scanning exactly one level. * gnus-start.el (gnus-get-unread-articles): Ditto. 2011-11-03 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: More commentary about setup. 2011-11-02 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: More commentary about `gnus-sync-read' issues. 2011-10-31 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: Improve docs about CouchDB admins. 2011-10-29 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el (gnus-sync-lesync-setup): Fix salt when user setup is not needed. Provide xmlplistread list function to produce XML plist output for non-Gnus LeSync clients. 2011-10-27 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: Add LeSync synchronization backend and logic to read and save against it. Group subscriptions, read marks, other marks, subscription levels, topic names, and topic offsets (the group's position within the topic) are saved. This is an experimental backend and may change significantly. Load json.el from the gnus-fallback-lib if it's not available otherwise. (gnus-sync-save): Don't use `apply-partially' because of XEmacs. 2011-04-20 David Engster <dengste@eml.cc> * tests/gnustest-nntp.el: New file for simple NNTP testing.
2012-06-26 22:52:31 +00:00
(defvar gnus-summary-line-format-spec nil)
(defvar gnus-summary-dummy-line-format-spec nil)
(defvar gnus-group-line-format-spec nil)
1997-04-16 22:13:18 +00:00
(defvar gnus-format-specs
`((version . ,emacs-version)
Merge changes made in Gnus master ever since feature freeze ::::::::::::::::: ::: doc/misc/ ::: ::::::::::::::::: 2012-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.texi (POP before SMTP): POP-before-SMTP works with all sending methods, so don't mention smtpmail here. 2012-05-04 Wolfgang Jenkner <wjenkner@inode.at> * gnus.texi (Picons): Document gnus-picon-properties. 2012-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.texi: Remove mention of compilation, as that's no longer supported. 2012-03-14 Christopher Schmidt <christopher@ch.ristopher.com> * gnus.texi (Archived Messages): Mention gnus-gcc-pre-body-encode-hook and gnus-gcc-post-body-encode-hook. 2012-02-16 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi (Various Summary Stuff): Remove mention of `gnus-propagate-marks'. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi: Remove mentions of nnml/nnfolder/nntp backend marks, which no longer exist. 2012-02-08 Katsumi Yamaoka <yamaoka@jpl.org> * gnus.texi (Archived Messages): Document gnus-gcc-self-resent-messages. 2012-02-06 Lars Ingebrigtsen <larsi@gnus.org> * message.texi (Mail Variables): Mention the optional user parameter for X-Message-SMTP-Method. 2012-02-02 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi (Posting Styles): Mention X-Message-SMTP-Method. * message.texi (Mail Variables): Document X-Message-SMTP-Method. 2012-01-31 Lars Ingebrigtsen <larsi@gnus.org> * gnus.texi (Key Index): Change encoding to utf-8. :::::::::::::::::: ::: lisp/gnus/ ::: :::::::::::::::::: 2012-06-26 Katsumi Yamaoka <yamaoka@jpl.org> * mm-decode.el: Add coding cookie for a soft hyphen that mm-shr uses. 2012-06-11 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus-art.el (gnus-article-read-summary-keys): Protect against the key being bound to a lambda form. 2012-05-04 Wolfgang Jenkner <wjenkner@inode.at> * gnus-picon.el (gnus-picon-properties): New defcustom. (gnus-picon-create-glyph): Use it. 2012-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * shr.el: Add a iso-8859-1 cookie to make stuff work under other locales. * mm-decode.el (mm-display-part): Dissect archives when hitting `RET' on a handle. * gnus-sum.el (gnus-summary-limit-to-author): Use the current From address as the default. * nnfolder.el (nnfolder-save-buffer): Delete old versions silently. It makes no sense to query the user about internal files. * gnus-spec.el: Remove all the byte-compilation stuff, since benchmarking shows that it doesn't help when entering large summary buffers. * gnus-util.el (gnus-byte-code): Remove. * gnus-spec.el (gnus-update-format-specifications): Remove outdated grouplens stuff. 2012-06-07 Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk> * message.el (message-buffers): Return all buffers derived from Message to make `gnus-dired-attach' work with mu4e. 2012-05-28 Daiki Ueno <ueno@unixuser.org> * mm-decode.el (mm-inhibit-auto-detect-attachment): New variable. (mm-dissect-singlepart): Don't guess the MIME type of application/octet-stream parts if mm-inhibit-auto-detect-attachment is set. (mm-dissect-multipart): Bind mm-inhibit-auto-detect-attachment if the toplevel MIME type is multipart/encrypted. 2011-12-02 Wolfgang Jenkner <wjenkner@inode.at> * gnus-agent.el (gnus-agent-save-active): Deal with the "groups" format. In particular, add an optional argument and a docstring. * gnus-start.el (gnus-groups-to-gnus-format): Use it. * nntp.el (nntp-finish-retrieve-group-infos): Make `nntp-server-buffer' current before calling `gnus-groups-to-gnus-format'. Note that this was already the case for `gnus-active-to-gnus-format'. 2012-04-25 Katsumi Yamaoka <yamaoka@jpl.org> * pop3.el (pop3-wait-for-messages): Fix retrieved data size calculation. 2012-04-12 Lars Magne Ingebrigtsen <larsi@gnus.org> * mm-decode.el (mm-dissect-buffer): Doc fix. * gnus-sum.el (gnus-handle-ephemeral-exit): Avoid creating the group buffer if it doesn't exist. * gnus-group.el (gnus-group-read-ephemeral-group): If no quit-config is given, mark the group as ephemeral with the current window conf. * gnus-sum.el (gnus-set-global-variables): Don't assume that the group buffer exists, which it doesn't if we haven't started Gnus. (gnus-summary-exit): Allow quitting when we don't have a group buffer. 2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * mml.el (mml-generate-mime): Allow specifying what the top-level part type is. * gnus-sum.el (gnus-auto-center-summary): `scroll-margin' isn't defined on XEmacs. 2012-04-10 Philipp Haselwarter <philipp.haselwarter@gmx.de> (tiny change) * gnus-sum.el (gnus-auto-center-summary): Set default to respect `scroll-margin'. 2012-04-10 Elias Oltmanns <eo@nebensachen.de> (tiny change) * gnus-cite.el (gnus-dissect-cited-text): A single line without citation prefix within a block of cited text should be considered part of that block *only* if it is a blank line. 2012-04-02 Katsumi Yamaoka <yamaoka@jpl.org> * shr.el (shr-find-fill-point): Remove unused code; don't break a line before kinsoku-bol characters nor within kinsoku-eol characters. 2012-03-27 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-sync.el (gnus-topic-alist, gnus-group-topic) (gnus-topic-create-topic, gnus-topic-enter-dribble): Silence compiler. (gnus-sync-read): Use mapc instead of mapcar. * mm-archive.el: Require mm-decode for some macros. (gnus-recursive-directory-files, mailcap-extension-to-mime): Silence the byte compiler. (mm-archive-decoders): New function that returns the value of the mm-archive-decoders variable. * mm-decode.el: Don't require mm-archive; autoload mm-archive functions instead. (mm-dissect-singlepart): Use the function mm-archive-decoders. * nnmail.el (mail-send-and-exit): Silence the byte compiler. 2012-03-12 Peter Munster <pmrb@free.fr> * gnus-demon.el (gnus-demon-timers): Now a plist (function -> timer). (gnus-demon-cancel): Ditto. (gnus-demon-run-callback): When function cannot be called due to low idleness, call it when idleness reaches the expected value, instead of waiting another timer period. (gnus-demon-init): Add `time' to arguments of call-back. 2012-03-22 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.el: Register gnus-registry functions. * gnus-registry.el (gnus-try-warping-via-registry): Moved here and indent. * gnus-int.el (gnus-warp-to-article): Check whether the registry is enabled before warping. 2012-03-22 Dave Abrahams <dave@boostpro.com> * gnus-sum.el (gnus-summary-insert-subject): Record information in the registry about each article retrieved. * gnus-int.el (gnus-select-group-with-message-id): New function. (gnus-try-warping-via-registry): Ditto. (gnus-warp-to-article): Fall back on the registry. 2012-03-22 Lars Magne Ingebrigtsen <larsi@gnus.org> * nnimap.el (nnimap-fetch-partial-articles): Minor doc string fixup. 2012-03-22 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-msg.el (gnus-summary-resend-message-insert-gcc): Assume that gnus-gcc-self-resent-messages may be a group parameter. (gnus-summary-resend-message): Don't encode encoded words in header when Gcc'ing resent message. 2012-03-19 Lars Magne Ingebrigtsen <larsi@gnus.org> * shr.el (shr-insert): Treat non-breaking space just like normal space. This seems to produce more pleasing results. (shr-insert): Only insert a blank line if we're starting from an image. (shr-tag-br): Allow <br> to end lines or to make a single blank line. (shr-ensure-paragraph): Consider lines with white space to be blank. 2012-03-14 Christopher Schmidt <christopher@ch.ristopher.com> * gnus-msg.el (gnus-inews-do-gcc): Add gnus-gcc-pre-body-encode-hook and gnus-gcc-post-body-encode-hook. 2012-02-16 Lars Ingebrigtsen <larsi@gnus.org> * mm-decode.el (mm-dissect-singlepart): Guess what the type of application/octet-stream parts really is. * gnus-sum.el (gnus-propagate-marks): Remove. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * nntp.el (nntp-coding-system-for-read): Remove. (nntp-coding-system-for-write): Ditto. (nntp-open-connection): Just use `binary' directly. 2012-02-14 Teodor Zlatanov <tzz@lifelogs.com> * registry.el (registry-usage-test, registry-persistence-test): Move to tests/gnustest-registry.el. (registry-make-testable-db, registry-match-test) (registry-instantiation-test): Move to tests/gnustest-registry.el. * gnus-registry.el (gnus-registry-misc-test) (gnus-registry-usage-test): Move to tests/gnustest-registry.el. * tests/gnustest-registry.el: New file with the registry and gnus-registry ERT tests. 2012-02-13 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-msg.el (gnus-summary-resend-message): Make gnus-summary-resend-message-insert-gcc be last item in message-header-setup-hook. 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org> * nnfolder.el (nnfolder-marks-directory, nnfolder-marks-is-evil) (nnfolder-marks, nnfolder-marks-file-suffix) (nnfolder-marks-modtime): Remove. (nnfolder-open-server): Don't use marks. (nnfolder-request-delete-group): Ditto. (nnfolder-request-rename-group): Ditto. (nnfolder-request-set-mark, nnfolder-request-marks) (nnfolder-group-marks-pathname, nnfolder-marks-changed-p) (nnfolder-save-marks, nnfolder-open-marks): Remove. * nnml.el (nnml-marks-is-evil, nnml-marks-file-name, nnml-marks) (nnml-marks-modtime): Remove. (nnml-request-delete-group): Don't use marks. (nnml-request-rename-group): Ditto. (nnml-request-set-mark, nnml-request-marks, nnml-marks-changed-p) (nnml-save-marks, nnml-open-marks): Remove. * nntp.el (nntp-marks-is-evil, nntp-marks-file-name, nntp-marks) (nntp-marks-modtime, nntp-marks-directory, nntp-request-set-mark) (nntp-request-marks, nntp-marks-directory, nntp-marks-changed-p) (nntp-save-marks, nntp-open-marks, nntp-possibly-create-directory) (nntp-server-to-method-cache): Remove. * shr.el (shr-rescale-image): Fix wrong merge. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * shr.el (shr-remove-trailing-whitespace): Really delete the padding on too-wide lines. 2012-02-09 Lars Ingebrigtsen <larsi@gnus.org> * mm-archive.el (mm-archive-dissect-and-inline): New function. (mm-archive-dissect-and-inline): Fix up the undisplayer. * mm-decode.el (mm-display-external): Output the text from the command in the buffer after the command finished. This makes text-based commands behave better. 2012-02-07 Lars Ingebrigtsen <larsi@gnus.org> * message.el (smtpmail-smtp-user): Silence compiler warning. 2012-02-06 Lars Ingebrigtsen <larsi@gnus.org> * message.el (message-multi-smtp-send-mail): Also allow specifying the SMTP user name. 2012-02-06 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-sum.el (gnus-summary-article-map): Fix typo. 2012-02-02 Lars Ingebrigtsen <larsi@gnus.org> * message.el (message-multi-smtp-send-mail): New function. (message-multi-smtp-send-mail): Respect the X-Message-SMTP-Method header to implement multi-SMTP functionality. * gnus-agent.el (gnus-agent-send-mail-function): Removed. (gnus-agentize): Don't set it. (gnus-agent-send-mail): Don't use it. * gnus-sum.el (gnus-summary-widget-backward): New function and keystroke. * shr.el (shr-put-image): Remove underlines from sliced images. (shr-zoom-image): Compute the region to be replaced more correctly. 2012-02-02 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-msg.el (gnus-gcc-self-resent-messages): New user option. (gnus-summary-resend-message-insert-gcc): New function. (gnus-summary-resend-message): Modify message-header-setup-hook and message-sent-hook to make it work for Gcc. (gnus-inews-do-gcc): Update the number of unread articles of groups that messages are Gcc'd to. * message.el (message-resend): Run message-sent-hook to do Gcc. 2012-02-01 Lars Ingebrigtsen <larsi@gnus.org> * gnus-registry.el (gnus-registry-fixup-registry): Move the message to a higher level to silence compilation. * gnus-art.el (gnus-shr-put-image): Take and pass on a `flags' parameter to allow controlling the scaling. * shr.el (shr-zoom-image): New command and keystroke. (shr-put-image): Take a `size' flag to say how to scale the image. * mm-archive.el (mm-dissect-archive): Use it to get all file names. Use recursive deletion. (mm-dissect-archive): Add support for zip files. * gnus-util.el (gnus-recursive-directory-files): New function. * mm-archive.el (mm-archive-list-files): Inline text and image parts. (mm-archive-decoders): Add tgz support. * mm-decode.el (mm-shr): Make sure that the HTML ends with a newline. Otherwise inserting text into the Gnus buffer can look odd. * gnus-art.el (gnus-mime-inline-part): Slight clean-up. * mm-archive.el (mm-archive-decoders): Add support for tar. * gnus.el (gnus-logo-color-alist): Change the colours for Ma Gnus. * nnmail.el (nnmail-extra-headers): Add Cc to the default. 2012-01-31 Lars Ingebrigtsen <larsi@gnus.org> * mm-decode.el (mm-dissect-singlepart): Check that the decoder exists. * mm-archive.el: New file. * mm-decode.el (mm-dissect-singlepart): Use it to decode ms-tnef files. * mm-util.el (mm-find-buffer-file-coding-system): Comment fix. * message.el (message-goto-*): Make all the `message-goto-*' commands push the mark before moving point. This makes it easier to go back to where you came from after editing whatever you jumped to. 2012-01-07 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el (gnus-sync-newsrc-groups): Quote normally. (gnus-sync-lesync-pre-save-group-entry): Remove invalid invlists. (gnus-sync-lesync-normalize-group-entry): Ignore a few more keys. 2011-11-09 Teodor Zlatanov <tzz@lifelogs.com> * spam.el: Move BBDB autoloads. (spam-exists-in-BBDB-p): New function to do the BBDB search directly in BBDB 2 and 3. (spam-check-BBDB): Use it. (spam-enter-ham-BBDB): Use it. 2011-10-31 Peter Munster <pmrb@free.fr> (tiny change) * gnus-group.el (gnus-group-get-new-news): New parameter `one-level' for scanning exactly one level. * gnus-start.el (gnus-get-unread-articles): Ditto. 2011-11-03 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: More commentary about setup. 2011-11-02 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: More commentary about `gnus-sync-read' issues. 2011-10-31 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: Improve docs about CouchDB admins. 2011-10-29 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el (gnus-sync-lesync-setup): Fix salt when user setup is not needed. Provide xmlplistread list function to produce XML plist output for non-Gnus LeSync clients. 2011-10-27 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sync.el: Add LeSync synchronization backend and logic to read and save against it. Group subscriptions, read marks, other marks, subscription levels, topic names, and topic offsets (the group's position within the topic) are saved. This is an experimental backend and may change significantly. Load json.el from the gnus-fallback-lib if it's not available otherwise. (gnus-sync-save): Don't use `apply-partially' because of XEmacs. 2011-04-20 David Engster <dengste@eml.cc> * tests/gnustest-nntp.el: New file for simple NNTP testing.
2012-06-26 22:52:31 +00:00
(gnus-version . ,(gnus-continuum-version)))
1997-04-16 22:13:18 +00:00
"Alist of format specs.")
(defvar gnus-default-format-specs gnus-format-specs)
1997-04-16 22:13:18 +00:00
(defvar gnus-article-mode-line-format-spec nil)
(defvar gnus-summary-mode-line-format-spec nil)
(defvar gnus-group-mode-line-format-spec nil)
;;; Phew. All that gruft is over with, fortunately.
1997-04-16 22:13:18 +00:00
;;;###autoload
(defun gnus-update-format (var)
"Update the format specification near point."
(interactive
(list
(save-excursion
(eval-defun nil)
;; Find the end of the current word.
(re-search-forward "[ \t\n]" nil t)
;; Search backward.
(when (re-search-backward "\\(gnus-[-a-z]+-line-format\\)" nil t)
(match-string 1)))))
(let* ((type (intern (progn (string-match "gnus-\\([-a-z]+\\)-line" var)
(match-string 1 var))))
(entry (assq type gnus-format-specs))
value spec)
(when entry
(setq gnus-format-specs (delq entry gnus-format-specs)))
(set
(intern (format "%s-spec" var))
(gnus-parse-format (setq value (symbol-value (intern var)))
(symbol-value (intern (format "%s-alist" var)))
(not (string-match "mode" var))))
(setq spec (symbol-value (intern (format "%s-spec" var))))
(push (list type value spec) gnus-format-specs)
(pop-to-buffer "*Gnus Format*")
(erase-buffer)
(lisp-interaction-mode)
(insert (gnus-pp-to-string spec))))
1997-04-16 22:13:18 +00:00
(defun gnus-update-format-specifications (&optional force &rest types)
"Update all (necessary) format specifications.
Return a list of updated types."
1997-04-16 22:13:18 +00:00
;; Make the indentation array.
;; See whether all the stored info needs to be flushed.
(when (or force
(not gnus-newsrc-file-version)
(not (equal (gnus-continuum-version)
(gnus-continuum-version gnus-newsrc-file-version)))
1997-04-16 22:13:18 +00:00
(not (equal emacs-version
(cdr (assq 'version gnus-format-specs)))))
(setq gnus-format-specs nil))
;; Go through all the formats and see whether they need updating.
(let (new-format entry type val updated)
1997-04-16 22:13:18 +00:00
(while (setq type (pop types))
;; Jump to the proper buffer to find out the value of the
;; variable, if possible. (It may be buffer-local.)
(save-current-buffer
(let ((buffer (intern (format "gnus-%s-buffer" type))))
1997-04-16 22:13:18 +00:00
(when (and (boundp buffer)
(setq val (symbol-value buffer))
Simplify Gnus buffer liveness checking and killing * lisp/gnus/gnus-agent.el (gnus-agent-synchronize-group-flags): Fix indentation. * lisp/gnus/gnus-util.el (gnus-buffer-exists-p): Define as obsolete alias of gnus-buffer-live-p. (gnus-buffer-live-p): If the given argument is or names a live buffer, return the corresponding buffer object instead of a boolean. * lisp/gnus/gnus-win.el (gnus-delete-windows-in-gnusey-frames) (gnus-remove-some-windows): Simplify. * lisp/gnus/gnus.el (gnus-prune-buffers): Redefine as alias of gnus-buffers. (gnus-kill-buffer, gnus-buffers, gnus-group-find-parameter): * lisp/gnus/gnus-art.el (gnus-kill-sticky-article-buffers) (gnus-request-article-this-buffer): * lisp/gnus/gnus-bcklg.el (gnus-backlog-shutdown): * lisp/gnus/gnus-cus.el (gnus-group-customize) (gnus-agent-customize-category): * lisp/gnus/gnus-draft.el (gnus-draft-edit-message): * lisp/gnus/gnus-group.el (gnus-group-set-mode-line) (gnus--abort-on-unsaved-message-buffers, gnus-group-compact-group): * lisp/gnus/gnus-msg.el (gnus-inews-add-send-actions) (gnus-summary-supersede-article, gnus-copy-article-buffer): * lisp/gnus/gnus-score.el (gnus-score-edit-current-scores) (gnus-score-edit-file): * lisp/gnus/gnus-spec.el (gnus-update-format-specifications): * lisp/gnus/gnus-srvr.el (gnus-server-compact-server): * lisp/gnus/gnus-start.el (gnus-clear-system, gnus-dribble-enter) (gnus-dribble-save, gnus-dribble-clear, gnus-save-newsrc-file): * lisp/gnus/gnus-sum.el (gnus-summary-setup-buffer) (gnus-update-summary-mark-positions, gnus-summary-exit) (gnus-deaden-summary, gnus-kill-or-deaden-summary) (gnus-summary-next-group): * lisp/gnus/gnus-win.el (gnus-configure-frame): * lisp/gnus/mail-source.el (mail-source-movemail): * lisp/gnus/message.el (message-with-reply-buffer) (message-with-reply, message-send-and-exit) (message-send-mail-with-sendmail, message-pop-to-buffer) (message-do-send-housekeeping, message-forward-make-body-plain) (message-forward-make-body-mml): * lisp/gnus/mm-decode.el (mm-display-external, mm-remove-part): * lisp/gnus/nnbabyl.el (nnbabyl-server-opened) (nnbabyl-possibly-change-newsgroup, nnbabyl-read-mbox) (nnbabyl-check-mbox): * lisp/gnus/nndiary.el (nndiary-save-nov): * lisp/gnus/nndoc.el (nndoc-close-group) (nndoc-possibly-change-buffer): * lisp/gnus/nnfolder.el (nnfolder-close-group, nnfolder-save-nov): * lisp/gnus/nnimap.el (nnimap-make-process-buffer, nnimap-keepalive) (nnimap-find-connection): * lisp/gnus/nnmail.el (nnmail-cache-open, nnmail-cache-close): * lisp/gnus/nnmbox.el (nnmbox-close-server, nnmbox-server-opened) (nnmbox-possibly-change-newsgroup, nnmbox-read-mbox): * lisp/gnus/nnml.el (nnml-save-incremental-nov, nnml-open-nov) (nnml-save-nov): * lisp/gnus/nnoo.el (nnoo-server-opened): * lisp/gnus/nntp.el (nntp-kill-buffer, nntp-make-process-buffer) (nntp-open-connection, nntp-async-trigger): * lisp/net/mairix.el (mairix-gnus-fetch-field): Simplify buffer liveness checking and killing, replacing buffer-name with buffer-live-p and gnus-buffer-exists-p with gnus-buffer-live-p or equivalent where applicable.
2019-05-05 00:28:57 +00:00
(gnus-buffer-live-p val))
* lisp/gnus: Misc simplifications found during conversion to lexical * lisp/gnus/nnoo.el (noo-import-1, nnoo-define-skeleton-1): Use `dolist`. (noo-map-functions, nnoo-define-basics): Directly emit the code rather than going through an intermediate function; this also avoids the use of `eval`. (noo-map-functions-1, nnoo-define-basics-1): Delete functions, folded into their corresponding macro. * lisp/gnus/gmm-utils.el (gmm-tool-bar-from-list): Demote `eval` to `symbol-value`. * lisp/gnus/gnus-art.el (gnus-button-handle-describe-key): Avoid `eval` since `kbd` is a function nowadays. (gnus-treat-part-number): Rename from `part-number`. (gnus-treat-total-parts): Rename from `total-parts`. (gnus-treat-article, gnus-treat-predicate): Adjust accordingly. * lisp/gnus/gnus-cache.el (gnus-agent-load-alist): Use `declare-function`. * lisp/gnus/gnus-group.el (gnus-cache-active-hashtb): Use `defvar`. (gnus-group-iterate): Make it a normal function since lexical scoping avoids the risk of name capture anyway. (gnus-group-delete-articles): Actually use the `oldp` arg. * lisp/gnus/gnus-html.el (gnus-html-wash-images): Fix debug message so it's emitted after the `url` var it prints is actually initialized. And avoid `setq` while we're at it. * lisp/gnus/gnus-msg.el (gnus-group-mail, gnus-group-news) (gnus-summary-mail-other-window, gnus-summary-news-other-window): Merge `let`s using `let*`. * lisp/gnus/gnus-spec.el (gnus-update-format-specifications): Tighten the scope of `buffer`, and tighten a regexp. (gnus-parse-simple-format): Reduce code duplication. * lisp/gnus/gnus-start.el (gnus-child-mode): Don't `defvar` it since we never use that variable and accordingly don't define it as a minor mode. * lisp/gnus/gnus-util.el (gnus-byte-compile): Simplify so it obeys `gnus-use-byte-compile` not just on the first call. (iswitchb-minibuffer-setup): Declare. * lisp/gnus/mail-source.el (mail-source-bind-1) (mail-source-bind-common-1): Use `mapcar`. (mail-source-set-common-1): Use `dolist`. (display-time-event-handler): Declare. * lisp/gnus/mml-smime.el (mml-smime-epg-verify): Reduce code duplication. * lisp/gnus/mml.el (mml-parse-1): Reduce code duplication. * lisp/gnus/mml2015.el (mml2015-epg-verify): Reduce code duplication. * lisp/gnus/nnmail.el (nnmail-get-split-group): Tighten regexp. (nnmail-split-it): Reduce code duplication. * lisp/gnus/nnweb.el (nnweb-request-article): Avoid `setq`. * lisp/gnus/spam.el (BBDB): Use the `noerror` arg of `require`, and define all the functions for BBDB regardless if the require succeeded. (spam-exists-in-BBDB-p): Don't inline, not worth it.
2021-01-30 21:45:25 +00:00
(set-buffer val)))
(setq new-format (symbol-value
(intern (format "gnus-%s-line-format" type))))
1997-04-16 22:13:18 +00:00
(setq entry (cdr (assq type gnus-format-specs)))
(if (and (car entry)
(equal (car entry) new-format))
;; Use the old format.
(set (intern (format "gnus-%s-line-format-spec" type))
(cadr entry))
;; This is a new format.
(setq val
(if (not (stringp new-format))
;; This is a function call or something.
new-format
;; This is a "real" format.
(gnus-parse-format
new-format
(symbol-value
(intern (format "gnus-%s-line-format-alist" type)))
* lisp/gnus: Misc simplifications found during conversion to lexical * lisp/gnus/nnoo.el (noo-import-1, nnoo-define-skeleton-1): Use `dolist`. (noo-map-functions, nnoo-define-basics): Directly emit the code rather than going through an intermediate function; this also avoids the use of `eval`. (noo-map-functions-1, nnoo-define-basics-1): Delete functions, folded into their corresponding macro. * lisp/gnus/gmm-utils.el (gmm-tool-bar-from-list): Demote `eval` to `symbol-value`. * lisp/gnus/gnus-art.el (gnus-button-handle-describe-key): Avoid `eval` since `kbd` is a function nowadays. (gnus-treat-part-number): Rename from `part-number`. (gnus-treat-total-parts): Rename from `total-parts`. (gnus-treat-article, gnus-treat-predicate): Adjust accordingly. * lisp/gnus/gnus-cache.el (gnus-agent-load-alist): Use `declare-function`. * lisp/gnus/gnus-group.el (gnus-cache-active-hashtb): Use `defvar`. (gnus-group-iterate): Make it a normal function since lexical scoping avoids the risk of name capture anyway. (gnus-group-delete-articles): Actually use the `oldp` arg. * lisp/gnus/gnus-html.el (gnus-html-wash-images): Fix debug message so it's emitted after the `url` var it prints is actually initialized. And avoid `setq` while we're at it. * lisp/gnus/gnus-msg.el (gnus-group-mail, gnus-group-news) (gnus-summary-mail-other-window, gnus-summary-news-other-window): Merge `let`s using `let*`. * lisp/gnus/gnus-spec.el (gnus-update-format-specifications): Tighten the scope of `buffer`, and tighten a regexp. (gnus-parse-simple-format): Reduce code duplication. * lisp/gnus/gnus-start.el (gnus-child-mode): Don't `defvar` it since we never use that variable and accordingly don't define it as a minor mode. * lisp/gnus/gnus-util.el (gnus-byte-compile): Simplify so it obeys `gnus-use-byte-compile` not just on the first call. (iswitchb-minibuffer-setup): Declare. * lisp/gnus/mail-source.el (mail-source-bind-1) (mail-source-bind-common-1): Use `mapcar`. (mail-source-set-common-1): Use `dolist`. (display-time-event-handler): Declare. * lisp/gnus/mml-smime.el (mml-smime-epg-verify): Reduce code duplication. * lisp/gnus/mml.el (mml-parse-1): Reduce code duplication. * lisp/gnus/mml2015.el (mml2015-epg-verify): Reduce code duplication. * lisp/gnus/nnmail.el (nnmail-get-split-group): Tighten regexp. (nnmail-split-it): Reduce code duplication. * lisp/gnus/nnweb.el (nnweb-request-article): Avoid `setq`. * lisp/gnus/spam.el (BBDB): Use the `noerror` arg of `require`, and define all the functions for BBDB regardless if the require succeeded. (spam-exists-in-BBDB-p): Don't inline, not worth it.
2021-01-30 21:45:25 +00:00
(not (string-match "mode\\'" (symbol-name type))))))
1997-04-16 22:13:18 +00:00
;; Enter the new format spec into the list.
(if entry
(progn
(setcar (cdr entry) val)
(setcar entry new-format))
(push (list type new-format val) gnus-format-specs))
(set (intern (format "gnus-%s-line-format-spec" type)) val)
(push type updated))))
1997-04-16 22:13:18 +00:00
(unless (assq 'version gnus-format-specs)
(push (cons 'version emacs-version) gnus-format-specs))
updated))
1997-04-16 22:13:18 +00:00
(defcustom gnus-mouse-face-0 'highlight
"The \"%(hello%)\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-mouse-face-1 'highlight
"The \"%1(hello%)\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-mouse-face-2 'highlight
"The \"%2(hello%)\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-mouse-face-3 'highlight
"The \"%3(hello%)\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-mouse-face-4 'highlight
"The \"%4(hello%)\" face."
:group 'gnus-format
:type 'face)
1997-04-16 22:13:18 +00:00
(defun gnus-mouse-face-function (form type)
`(put-text-property
1997-04-16 22:13:18 +00:00
(point) (progn ,@form (point))
'mouse-face
1997-04-16 22:13:18 +00:00
,(if (equal type 0)
'gnus-mouse-face
`(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type)))))))
(defcustom gnus-face-0 'bold
"The \"%{hello%}\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-face-1 'italic
"The \"%1{hello%}\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-face-2 'bold-italic
"The \"%2{hello%}\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-face-3 'bold
"The \"%3{hello%}\" face."
:group 'gnus-format
:type 'face)
(defcustom gnus-face-4 'bold
"The \"%4{hello%}\" face."
:group 'gnus-format
:type 'face)
1997-04-16 22:13:18 +00:00
(defun gnus-face-face-function (form type)
`(add-text-properties
1997-04-16 22:13:18 +00:00
(point) (progn ,@form (point))
Merge changes made in Gnus master 2012-12-25 Lars Ingebrigtsen <larsi@gnus.org> * gnus-sum.el (gnus-set-global-variables): Don't copy over the summary buffer to the article buffer here, because that clobbers multiple article buffers. * gnus-art.el (gnus-article-setup-buffer): Make sure that the article buffer always points to the right summary buffer. 2012-12-25 John Wiegley <jwiegley@gmail.com> * auth-source.el (auth-source-netrc-parse): Allow using "password" as the password (bug#12097). 2012-12-25 Lars Ingebrigtsen <larsi@gnus.org> * shr.el (shr-tag-a): Don't tagify <A> elements that don't have HREFs (bug#13263). * gnus-salt.el (gnus-highlight-selected-tree): Check whether the Tree buffer exists before using it (bug#12475). * gnus-agent.el (gnus-agent-fetch-articles): Don't fetch articles from offline groups (bug#11937). * message.el (message-yank-original): When using customize to set the value of `message-cite-style', the variable it set to a symbol that's the name of the variable, which must then be dereferenced (bug#12616). 2012-09-13 Wolfgang Jenkner <wjenkner@inode.at> * lisp/gnus-spec.el (gnus-face-face-function): Initialize the value of the `face' property with a list whose car is the face specified in the format string and whose cdr is (nil). * lisp/gnus-util.el (gnus-put-text-property-excluding-characters-with-faces): Change accordingly. (gnus-get-text-property-excluding-characters-with-faces): New function. * lisp/gnus-sum.el (gnus-summary-highlight-line): * lisp/gnus-salt.el (gnus-tree-highlight-node): * lisp/gnus-group.el (gnus-group-highlight-line): Use it.
2012-12-25 22:12:59 +00:00
(cons 'face
(cons
;; Delay consing the value of the `face' property until
;; `add-text-properties' runs, since it will be modified
;; by `put-text-property-excluding-characters-with-faces'.
(list ',(symbol-value (intern (format "gnus-face-%d" type))) 'default)
Merge changes made in Gnus master 2012-12-25 Lars Ingebrigtsen <larsi@gnus.org> * gnus-sum.el (gnus-set-global-variables): Don't copy over the summary buffer to the article buffer here, because that clobbers multiple article buffers. * gnus-art.el (gnus-article-setup-buffer): Make sure that the article buffer always points to the right summary buffer. 2012-12-25 John Wiegley <jwiegley@gmail.com> * auth-source.el (auth-source-netrc-parse): Allow using "password" as the password (bug#12097). 2012-12-25 Lars Ingebrigtsen <larsi@gnus.org> * shr.el (shr-tag-a): Don't tagify <A> elements that don't have HREFs (bug#13263). * gnus-salt.el (gnus-highlight-selected-tree): Check whether the Tree buffer exists before using it (bug#12475). * gnus-agent.el (gnus-agent-fetch-articles): Don't fetch articles from offline groups (bug#11937). * message.el (message-yank-original): When using customize to set the value of `message-cite-style', the variable it set to a symbol that's the name of the variable, which must then be dereferenced (bug#12616). 2012-09-13 Wolfgang Jenkner <wjenkner@inode.at> * lisp/gnus-spec.el (gnus-face-face-function): Initialize the value of the `face' property with a list whose car is the face specified in the format string and whose cdr is (nil). * lisp/gnus-util.el (gnus-put-text-property-excluding-characters-with-faces): Change accordingly. (gnus-get-text-property-excluding-characters-with-faces): New function. * lisp/gnus-sum.el (gnus-summary-highlight-line): * lisp/gnus-salt.el (gnus-tree-highlight-node): * lisp/gnus-group.el (gnus-group-highlight-line): Use it.
2012-12-25 22:12:59 +00:00
;; Redundant now, but still convenient.
'(gnus-face t)))))
1997-04-16 22:13:18 +00:00
(defun gnus-balloon-face-function (form type)
`(put-text-property
(point) (progn ,@form (point)) 'help-echo
,(intern (format "gnus-balloon-face-%d" type))))
(defun gnus-spec-tab (column)
(if (> column 0)
`(insert-char ? (max (- ,column (current-column)) 0))
(let ((column (abs column)))
`(if (> (current-column) ,column)
(let ((end (point)))
(if (= (move-to-column ,column) ,column)
(delete-region (point) end)
(delete-region (1- (point)) end)
(insert " ")))
(insert-char ? (max (- ,column (current-column)) 0))))))
(define-obsolete-function-alias 'gnus-correct-length 'string-width "27.1")
(defun gnus-correct-substring (string start &optional end)
(let ((wstart 0)
(wend 0)
(wseek 0)
(seek 0)
(length (length string))
(string (concat string "\0")))
;; Find the start position.
(while (and (< seek length)
(< wseek start))
gnus: replace cl with cl-lib * lisp/gnus/gnus-agent.el, lisp/gnus/gnus-art.el: * lisp/gnus/gnus-async.el, lisp/gnus/gnus-cache.el: * lisp/gnus/gnus-demon.el, lisp/gnus/gnus-group.el: * lisp/gnus/gnus-icalendar.el, lisp/gnus/gnus-logic.el: * lisp/gnus/gnus-msg.el, lisp/gnus/gnus-picon.el: * lisp/gnus/gnus-registry.el, lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-score.el, lisp/gnus/gnus-spec.el: * lisp/gnus/gnus-srvr.el, lisp/gnus/gnus-start.el: * lisp/gnus/gnus-sum.el, lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el, lisp/gnus/gnus-uu.el, lisp/gnus/gnus-win.el: * lisp/gnus/mail-source.el, lisp/gnus/mm-decode.el: * lisp/gnus/mm-encode.el, lisp/gnus/mm-url.el, lisp/gnus/mm-view.el: * lisp/gnus/mml-smime.el, lisp/gnus/mml.el, lisp/gnus/mml2015.el: * lisp/gnus/nnbabyl.el, lisp/gnus/nndoc.el, lisp/gnus/nneething.el: * lisp/gnus/nnheader.el, lisp/gnus/nnimap.el, lisp/gnus/nnmail.el: * lisp/gnus/nnmaildir.el, lisp/gnus/nnoo.el, lisp/gnus/nnrss.el: * lisp/gnus/nnspool.el, lisp/gnus/nntp.el, lisp/gnus/nnvirtual.el: * lisp/gnus/nnweb.el, lisp/gnus/spam.el: Replace cl with cl-lib. * lisp/gnus/canlock.el, lisp/gnus/gnus-bcklg.el: * lisp/gnus/gnus-cite.el, lisp/gnus/gnus-cloud.el: * lisp/gnus/gnus-draft.el, lisp/gnus/gnus-dup.el: * lisp/gnus/gnus-fun.el, lisp/gnus/gnus-html.el: * lisp/gnus/gnus-int.el, lisp/gnus/gnus-kill.el, lisp/gnus/gnus-ml.el: * lisp/gnus/gnus-mlspl.el, lisp/gnus/gnus-range.el: * lisp/gnus/gnus-undo.el, lisp/gnus/gnus-vm.el: * lisp/gnus/mm-partial.el, lisp/gnus/mm-uu.el, lisp/gnus/mml1991.el: * lisp/gnus/nnagent.el, lisp/gnus/nndiary.el, lisp/gnus/nndir.el: * lisp/gnus/nndraft.el, lisp/gnus/nnfolder.el, lisp/gnus/nngateway.el: * lisp/gnus/nnmairix.el, lisp/gnus/nnmbox.el, lisp/gnus/nnmh.el: * lisp/gnus/nnml.el, lisp/gnus/score-mode.el, lisp/gnus/smiley.el: No need for cl.
2018-03-23 20:13:09 +00:00
(cl-incf wseek (char-width (aref string seek)))
(cl-incf seek))
(setq wstart seek)
;; Find the end position.
(while (and (<= seek length)
(or (not end)
(<= wseek end)))
gnus: replace cl with cl-lib * lisp/gnus/gnus-agent.el, lisp/gnus/gnus-art.el: * lisp/gnus/gnus-async.el, lisp/gnus/gnus-cache.el: * lisp/gnus/gnus-demon.el, lisp/gnus/gnus-group.el: * lisp/gnus/gnus-icalendar.el, lisp/gnus/gnus-logic.el: * lisp/gnus/gnus-msg.el, lisp/gnus/gnus-picon.el: * lisp/gnus/gnus-registry.el, lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-score.el, lisp/gnus/gnus-spec.el: * lisp/gnus/gnus-srvr.el, lisp/gnus/gnus-start.el: * lisp/gnus/gnus-sum.el, lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el, lisp/gnus/gnus-uu.el, lisp/gnus/gnus-win.el: * lisp/gnus/mail-source.el, lisp/gnus/mm-decode.el: * lisp/gnus/mm-encode.el, lisp/gnus/mm-url.el, lisp/gnus/mm-view.el: * lisp/gnus/mml-smime.el, lisp/gnus/mml.el, lisp/gnus/mml2015.el: * lisp/gnus/nnbabyl.el, lisp/gnus/nndoc.el, lisp/gnus/nneething.el: * lisp/gnus/nnheader.el, lisp/gnus/nnimap.el, lisp/gnus/nnmail.el: * lisp/gnus/nnmaildir.el, lisp/gnus/nnoo.el, lisp/gnus/nnrss.el: * lisp/gnus/nnspool.el, lisp/gnus/nntp.el, lisp/gnus/nnvirtual.el: * lisp/gnus/nnweb.el, lisp/gnus/spam.el: Replace cl with cl-lib. * lisp/gnus/canlock.el, lisp/gnus/gnus-bcklg.el: * lisp/gnus/gnus-cite.el, lisp/gnus/gnus-cloud.el: * lisp/gnus/gnus-draft.el, lisp/gnus/gnus-dup.el: * lisp/gnus/gnus-fun.el, lisp/gnus/gnus-html.el: * lisp/gnus/gnus-int.el, lisp/gnus/gnus-kill.el, lisp/gnus/gnus-ml.el: * lisp/gnus/gnus-mlspl.el, lisp/gnus/gnus-range.el: * lisp/gnus/gnus-undo.el, lisp/gnus/gnus-vm.el: * lisp/gnus/mm-partial.el, lisp/gnus/mm-uu.el, lisp/gnus/mml1991.el: * lisp/gnus/nnagent.el, lisp/gnus/nndiary.el, lisp/gnus/nndir.el: * lisp/gnus/nndraft.el, lisp/gnus/nnfolder.el, lisp/gnus/nngateway.el: * lisp/gnus/nnmairix.el, lisp/gnus/nnmbox.el, lisp/gnus/nnmh.el: * lisp/gnus/nnml.el, lisp/gnus/score-mode.el, lisp/gnus/smiley.el: No need for cl.
2018-03-23 20:13:09 +00:00
(cl-incf wseek (char-width (aref string seek)))
(cl-incf seek))
(setq wend seek)
(substring string wstart (1- wend))))
1997-04-16 22:13:18 +00:00
(defun gnus-tilde-max-form (el max-width)
"Return a form that limits EL to MAX-WIDTH."
(let ((max (abs max-width)))
1997-04-16 22:13:18 +00:00
(if (symbolp el)
`(if (> (string-width ,el) ,max)
1997-04-16 22:13:18 +00:00
,(if (< max-width 0)
`(gnus-correct-substring ,el (- (string-width ,el) ,max))
`(if (gnus-lrm-string-p ,el)
(concat (gnus-correct-substring ,el 0 ,max)
,gnus-lrm-string)
(gnus-correct-substring ,el 0 ,max)))
1997-04-16 22:13:18 +00:00
,el)
`(let ((val (eval ,el)))
(if (> (string-width val) ,max)
1997-04-16 22:13:18 +00:00
,(if (< max-width 0)
`(gnus-correct-substring val (- (string-width val) ,max))
`(if (gnus-lrm-string-p val)
(concat (gnus-correct-substring val 0 ,max)
,gnus-lrm-string)
(gnus-correct-substring val 0 ,max)))
1997-04-16 22:13:18 +00:00
val)))))
(defun gnus-tilde-cut-form (el cut-width)
"Return a form that cuts CUT-WIDTH off of EL."
(let ((cut (abs cut-width)))
1997-04-16 22:13:18 +00:00
(if (symbolp el)
`(if (> (string-width ,el) ,cut)
1997-04-16 22:13:18 +00:00
,(if (< cut-width 0)
`(gnus-correct-substring ,el 0 (- (string-width ,el) ,cut))
`(gnus-correct-substring ,el ,cut))
1997-04-16 22:13:18 +00:00
,el)
`(let ((val (eval ,el)))
(if (> (string-width val) ,cut)
1997-04-16 22:13:18 +00:00
,(if (< cut-width 0)
`(gnus-correct-substring val 0 (- (string-width val) ,cut))
`(gnus-correct-substring val ,cut))
1997-04-16 22:13:18 +00:00
val)))))
(defun gnus-tilde-ignore-form (el ignore-value)
"Return a form that is blank when EL is IGNORE-VALUE."
(if (symbolp el)
`(if (equal ,el ,ignore-value)
"" ,el)
`(let ((val (eval ,el)))
(if (equal val ,ignore-value)
"" val))))
(defun gnus-pad-form (el pad-width)
"Return a form that pads EL to PAD-WIDTH accounting for multi-column
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-20 22:27:53 +00:00
characters correctly. This is because `format' may pad to columns
or to characters when given a pad value."
(let ((pad (abs pad-width))
(side (< 0 pad-width)))
(if (symbolp el)
`(let ((need (- ,pad (string-width ,el))))
(if (> need 0)
(concat ,(when side '(make-string need ?\ ))
,el
,(when (not side) '(make-string need ?\ )))
,el))
`(let* ((val (eval ,el))
(need (- ,pad (string-width val))))
(if (> need 0)
(concat ,(when side '(make-string need ?\ ))
val
,(when (not side) '(make-string need ?\ )))
val)))))
1997-04-16 22:13:18 +00:00
(defun gnus-parse-format (format spec-alist &optional insert)
;; This function parses the FORMAT string with the help of the
;; SPEC-ALIST and returns a list that can be eval'ed to return the
;; string. If the FORMAT string contains the specifiers %( and %)
;; the text between them will have the mouse-face text property.
;; If the FORMAT string contains the specifiers %[ and %], the text between
;; them will have the balloon-help text property.
(let ((case-fold-search nil))
(if (string-match
"\\`\\(.*\\)%[0-9]?[{(«]\\(.*\\)%[0-9]?[»})]\\(.*\n?\\)\\'\\|%[-0-9]*=\\|%[-0-9]*\\*"
format)
(gnus-parse-complex-format format spec-alist)
;; This is a simple format.
(gnus-parse-simple-format format spec-alist insert))))
1997-04-16 22:13:18 +00:00
(defun gnus-parse-complex-format (format spec-alist)
(let ((cursor-spec nil))
(save-excursion
(gnus-set-work-buffer)
(insert format)
(goto-char (point-min))
(while (re-search-forward "\"" nil t)
(replace-match "\\\"" nil t))
(goto-char (point-min))
(insert "(\"")
;; Convert all font specs into font spec lists.
(while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t)
(let ((number (if (match-beginning 1)
(match-string 1) "0"))
(delim (aref (match-string 2) 0)))
(if (or (= delim ?\()
(= delim ?\{)
(= delim 171)) ; «
(replace-match (concat "\"("
(cond ((= delim ?\() "mouse")
((= delim ?\{) "face")
(t "balloon"))
" " number " \"")
t t)
(replace-match "\")\""))))
(goto-char (point-max))
(insert "\")")
;; Convert point position commands.
(goto-char (point-min))
(let ((case-fold-search nil))
(while (re-search-forward "%\\([-0-9]+\\)?\\*" nil t)
(replace-match "\"(point)\"" t t)
(setq cursor-spec t)))
;; Convert TAB commands.
(goto-char (point-min))
(while (re-search-forward "%\\([-0-9]+\\)=" nil t)
(replace-match (format "\"(tab %s)\"" (match-string 1)) t t))
;; Convert the buffer into the spec.
(goto-char (point-min))
(let ((form (read (current-buffer))))
(if cursor-spec
`(let (gnus-position)
,@(gnus-complex-form-to-spec form spec-alist)
(if gnus-position
(put-text-property gnus-position (1+ gnus-position)
'gnus-position t)))
`(progn
,@(gnus-complex-form-to-spec form spec-alist)))))))
1997-04-16 22:13:18 +00:00
(defun gnus-complex-form-to-spec (form spec-alist)
(delq nil
(mapcar
(lambda (sform)
(cond
((stringp sform)
(gnus-parse-simple-format sform spec-alist t))
((eq (car sform) 'point)
'(setq gnus-position (point)))
((eq (car sform) 'tab)
(gnus-spec-tab (cadr sform)))
(t
1997-04-16 22:13:18 +00:00
(funcall (intern (format "gnus-%s-face-function" (car sform)))
(gnus-complex-form-to-spec (cddr sform) spec-alist)
(nth 1 sform)))))
1997-04-16 22:13:18 +00:00
form)))
(defun gnus-parse-simple-format (format spec-alist &optional insert)
;; This function parses the FORMAT string with the help of the
;; SPEC-ALIST and returns a list that can be eval'ed to return a
;; string.
(let ((max-width 0)
spec flist fstring elem result dontinsert user-defined
type value pad-width spec-beg cut-width ignore-value
tilde-form tilde elem-type extended-spec)
1997-04-16 22:13:18 +00:00
(save-excursion
(gnus-set-work-buffer)
(insert format)
(goto-char (point-min))
(while (re-search-forward "%" nil t)
(setq user-defined nil
spec-beg nil
pad-width nil
max-width nil
cut-width nil
ignore-value nil
tilde-form nil
extended-spec nil)
1997-04-16 22:13:18 +00:00
(setq spec-beg (1- (point)))
;; Parse this spec fully.
(while
(cond
((looking-at "\\([-.0-9]+\\)\\(,[-0-9]+\\)?")
(setq pad-width (string-to-number (match-string 1)))
(when (match-beginning 2)
(setq max-width (string-to-number (buffer-substring
(1+ (match-beginning 2))
(match-end 2)))))
(goto-char (match-end 0)))
((looking-at "~")
(forward-char 1)
(setq tilde (read (current-buffer))
type (car tilde)
value (cadr tilde))
(cond
((memq type '(pad pad-left))
(setq pad-width value))
((eq type 'pad-right)
(setq pad-width (- value)))
((memq type '(max-right max))
(setq max-width value))
((eq type 'max-left)
(setq max-width (- value)))
((memq type '(cut cut-left))
(setq cut-width value))
((eq type 'cut-right)
(setq cut-width (- value)))
((eq type 'ignore)
(setq ignore-value
(if (stringp value) value (format "%s" value))))
((eq type 'form)
(setq tilde-form value))
(t
(error "Unknown tilde type: %s" tilde)))
t)
(t
nil)))
(cond
;; User-defined spec -- find the spec name.
((eq (setq spec (char-after)) ?u)
1997-04-16 22:13:18 +00:00
(forward-char 1)
(when (and (eq (setq user-defined (char-after)) ?&)
(looking-at "&\\([^;]+\\);"))
(setq user-defined (match-string 1))
(goto-char (match-end 1))))
;; extended spec
((and (eq spec ?&) (looking-at "&\\([^;]+\\);"))
(setq extended-spec (intern (match-string 1)))
(goto-char (match-end 1))))
1997-04-16 22:13:18 +00:00
(forward-char 1)
(delete-region spec-beg (point))
;; Now we have all the relevant data on this spec, so
;; we start doing stuff.
(insert "%")
(if (eq spec ?%)
;; "%%" just results in a "%".
(insert "%")
* lisp/gnus: Misc simplifications found during conversion to lexical * lisp/gnus/nnoo.el (noo-import-1, nnoo-define-skeleton-1): Use `dolist`. (noo-map-functions, nnoo-define-basics): Directly emit the code rather than going through an intermediate function; this also avoids the use of `eval`. (noo-map-functions-1, nnoo-define-basics-1): Delete functions, folded into their corresponding macro. * lisp/gnus/gmm-utils.el (gmm-tool-bar-from-list): Demote `eval` to `symbol-value`. * lisp/gnus/gnus-art.el (gnus-button-handle-describe-key): Avoid `eval` since `kbd` is a function nowadays. (gnus-treat-part-number): Rename from `part-number`. (gnus-treat-total-parts): Rename from `total-parts`. (gnus-treat-article, gnus-treat-predicate): Adjust accordingly. * lisp/gnus/gnus-cache.el (gnus-agent-load-alist): Use `declare-function`. * lisp/gnus/gnus-group.el (gnus-cache-active-hashtb): Use `defvar`. (gnus-group-iterate): Make it a normal function since lexical scoping avoids the risk of name capture anyway. (gnus-group-delete-articles): Actually use the `oldp` arg. * lisp/gnus/gnus-html.el (gnus-html-wash-images): Fix debug message so it's emitted after the `url` var it prints is actually initialized. And avoid `setq` while we're at it. * lisp/gnus/gnus-msg.el (gnus-group-mail, gnus-group-news) (gnus-summary-mail-other-window, gnus-summary-news-other-window): Merge `let`s using `let*`. * lisp/gnus/gnus-spec.el (gnus-update-format-specifications): Tighten the scope of `buffer`, and tighten a regexp. (gnus-parse-simple-format): Reduce code duplication. * lisp/gnus/gnus-start.el (gnus-child-mode): Don't `defvar` it since we never use that variable and accordingly don't define it as a minor mode. * lisp/gnus/gnus-util.el (gnus-byte-compile): Simplify so it obeys `gnus-use-byte-compile` not just on the first call. (iswitchb-minibuffer-setup): Declare. * lisp/gnus/mail-source.el (mail-source-bind-1) (mail-source-bind-common-1): Use `mapcar`. (mail-source-set-common-1): Use `dolist`. (display-time-event-handler): Declare. * lisp/gnus/mml-smime.el (mml-smime-epg-verify): Reduce code duplication. * lisp/gnus/mml.el (mml-parse-1): Reduce code duplication. * lisp/gnus/mml2015.el (mml2015-epg-verify): Reduce code duplication. * lisp/gnus/nnmail.el (nnmail-get-split-group): Tighten regexp. (nnmail-split-it): Reduce code duplication. * lisp/gnus/nnweb.el (nnweb-request-article): Avoid `setq`. * lisp/gnus/spam.el (BBDB): Use the `noerror` arg of `require`, and define all the functions for BBDB regardless if the require succeeded. (spam-exists-in-BBDB-p): Don't inline, not worth it.
2021-01-30 21:45:25 +00:00
(setq elem
(cond
;; Do tilde forms.
((eq spec ?@)
(list tilde-form ?s))
;; Treat user defined format specifiers specially.
(user-defined
1997-04-16 22:13:18 +00:00
(list
(list (intern (format
(if (stringp user-defined)
"gnus-user-format-function-%s"
"gnus-user-format-function-%c")
user-defined))
1997-04-16 22:13:18 +00:00
'gnus-tmp-header)
* lisp/gnus: Misc simplifications found during conversion to lexical * lisp/gnus/nnoo.el (noo-import-1, nnoo-define-skeleton-1): Use `dolist`. (noo-map-functions, nnoo-define-basics): Directly emit the code rather than going through an intermediate function; this also avoids the use of `eval`. (noo-map-functions-1, nnoo-define-basics-1): Delete functions, folded into their corresponding macro. * lisp/gnus/gmm-utils.el (gmm-tool-bar-from-list): Demote `eval` to `symbol-value`. * lisp/gnus/gnus-art.el (gnus-button-handle-describe-key): Avoid `eval` since `kbd` is a function nowadays. (gnus-treat-part-number): Rename from `part-number`. (gnus-treat-total-parts): Rename from `total-parts`. (gnus-treat-article, gnus-treat-predicate): Adjust accordingly. * lisp/gnus/gnus-cache.el (gnus-agent-load-alist): Use `declare-function`. * lisp/gnus/gnus-group.el (gnus-cache-active-hashtb): Use `defvar`. (gnus-group-iterate): Make it a normal function since lexical scoping avoids the risk of name capture anyway. (gnus-group-delete-articles): Actually use the `oldp` arg. * lisp/gnus/gnus-html.el (gnus-html-wash-images): Fix debug message so it's emitted after the `url` var it prints is actually initialized. And avoid `setq` while we're at it. * lisp/gnus/gnus-msg.el (gnus-group-mail, gnus-group-news) (gnus-summary-mail-other-window, gnus-summary-news-other-window): Merge `let`s using `let*`. * lisp/gnus/gnus-spec.el (gnus-update-format-specifications): Tighten the scope of `buffer`, and tighten a regexp. (gnus-parse-simple-format): Reduce code duplication. * lisp/gnus/gnus-start.el (gnus-child-mode): Don't `defvar` it since we never use that variable and accordingly don't define it as a minor mode. * lisp/gnus/gnus-util.el (gnus-byte-compile): Simplify so it obeys `gnus-use-byte-compile` not just on the first call. (iswitchb-minibuffer-setup): Declare. * lisp/gnus/mail-source.el (mail-source-bind-1) (mail-source-bind-common-1): Use `mapcar`. (mail-source-set-common-1): Use `dolist`. (display-time-event-handler): Declare. * lisp/gnus/mml-smime.el (mml-smime-epg-verify): Reduce code duplication. * lisp/gnus/mml.el (mml-parse-1): Reduce code duplication. * lisp/gnus/mml2015.el (mml2015-epg-verify): Reduce code duplication. * lisp/gnus/nnmail.el (nnmail-get-split-group): Tighten regexp. (nnmail-split-it): Reduce code duplication. * lisp/gnus/nnweb.el (nnweb-request-article): Avoid `setq`. * lisp/gnus/spam.el (BBDB): Use the `noerror` arg of `require`, and define all the functions for BBDB regardless if the require succeeded. (spam-exists-in-BBDB-p): Don't inline, not worth it.
2021-01-30 21:45:25 +00:00
?s))
;; Find the specification from `spec-alist'.
((cdr (assq (or extended-spec spec) spec-alist)))
;; We used to use "%l" for displaying the grouplens score.
((eq spec ?l)
'("" ?s))
(t
'("*" ?s))))
1997-04-16 22:13:18 +00:00
(setq elem-type (cadr elem))
;; Insert the new format elements.
(when pad-width
1997-04-16 22:13:18 +00:00
(insert (number-to-string pad-width)))
2011-12-19 06:21:24 +00:00
;; Create the form to be evalled.
(if (or max-width cut-width ignore-value)
1997-04-16 22:13:18 +00:00
(progn
(insert ?s)
(let ((el (car elem)))
(cond ((= (cadr elem) ?c)
(setq el (list 'char-to-string el)))
((= (cadr elem) ?d)
(setq el (list 'int-to-string el))))
(when ignore-value
(setq el (gnus-tilde-ignore-form el ignore-value)))
(when cut-width
(setq el (gnus-tilde-cut-form el cut-width)))
(when max-width
(setq el (gnus-tilde-max-form el max-width)))
(when pad-width
(setq el (gnus-pad-form el pad-width)))
1997-04-16 22:13:18 +00:00
(push el flist)))
(insert elem-type)
(push (car elem) flist))))
(setq fstring (buffer-substring-no-properties (point-min) (point-max))))
1997-04-16 22:13:18 +00:00
;; Do some postprocessing to increase efficiency.
(setq
result
(cond
;; Emptiness.
1997-04-16 22:13:18 +00:00
((string= fstring "")
nil)
;; Not a format string.
Use string-search instead of string-match[-p] `string-search` is easier to understand, less error-prone, much faster, does not pollute the regexp cache, and does not mutate global state. Use it where applicable and obviously safe (erring on the conservative side). * admin/authors.el (authors-canonical-file-name) (authors-scan-change-log): * lisp/apropos.el (apropos-command) (apropos-documentation-property, apropos-symbols-internal): * lisp/arc-mode.el (archive-arc-summarize) (archive-zoo-summarize): * lisp/calc/calc-aent.el (math-read-factor): * lisp/calc/calc-ext.el (math-read-big-expr) (math-format-nice-expr, math-format-number-fancy): * lisp/calc/calc-forms.el (math-read-angle-brackets): * lisp/calc/calc-graph.el (calc-graph-set-range): * lisp/calc/calc-keypd.el (calc-keypad-press): * lisp/calc/calc-lang.el (tex, latex, math-read-big-rec): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-user-define-permanent, math-define-exp): * lisp/calc/calc.el (calc-record, calcDigit-key) (calc-count-lines): * lisp/calc/calcalg2.el (calc-solve-for, calc-poly-roots) (math-do-integral): * lisp/calc/calcalg3.el (calc-find-root, calc-find-minimum) (calc-get-fit-variables): * lisp/cedet/ede/speedbar.el (ede-tag-expand): * lisp/cedet/semantic/java.el (semantic-java-expand-tag): * lisp/cedet/semantic/sb.el (semantic-sb-show-extra) (semantic-sb-expand-group): * lisp/cedet/semantic/wisent/python.el (semantic-python-instance-variable-p): * lisp/cus-edit.el (get): * lisp/descr-text.el (describe-text-sexp): * lisp/dired-aux.el (dired-compress-file): * lisp/dired-x.el (dired-make-relative-symlink): * lisp/dired.el (dired-glob-regexp): * lisp/dos-fns.el (dos-convert-standard-filename, dos-8+3-filename): * lisp/edmacro.el (edmacro-format-keys): * lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand): * lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand): * lisp/emacs-lisp/lisp-mnt.el (lm-keywords-list): * lisp/emacs-lisp/warnings.el (display-warning): * lisp/emulation/viper-ex.el (viper-ex-read-file-name) (ex-print-display-lines): * lisp/env.el (read-envvar-name, setenv): * lisp/epa-mail.el (epa-mail-encrypt): * lisp/epg.el (epg--start): * lisp/erc/erc-backend.el (erc-parse-server-response): * lisp/erc/erc-dcc.el (erc-dcc-member): * lisp/erc/erc-speedbar.el (erc-speedbar-expand-server) (erc-speedbar-expand-channel, erc-speedbar-expand-user): * lisp/erc/erc.el (erc-send-input): * lisp/eshell/em-glob.el (eshell-glob-entries): * lisp/eshell/esh-proc.el (eshell-needs-pipe-p): * lisp/eshell/esh-util.el (eshell-convert): * lisp/eshell/esh-var.el (eshell-envvar-names): * lisp/faces.el (x-resolve-font-name): * lisp/ffap.el (ffap-file-at-point): * lisp/files.el (wildcard-to-regexp, shell-quote-wildcard-pattern): * lisp/forms.el (forms--update): * lisp/frameset.el (frameset-filter-unshelve-param): * lisp/gnus/gnus-art.el (article-decode-charset): * lisp/gnus/gnus-kill.el (gnus-kill-parse-rn-kill-file): * lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy): * lisp/gnus/gnus-msg.el (gnus-summary-resend-message-insert-gcc) (gnus-inews-insert-gcc): * lisp/gnus/gnus-rfc1843.el (rfc1843-decode-article-body): * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output) (gnus-search--complete-key-data): * lisp/gnus/gnus-spec.el (gnus-parse-simple-format): * lisp/gnus/gnus-sum.el (gnus-summary-refer-article): * lisp/gnus/gnus-util.el (gnus-extract-address-components) (gnus-newsgroup-directory-form): * lisp/gnus/gnus-uu.el (gnus-uu-grab-view): * lisp/gnus/gnus.el (gnus-group-native-p, gnus-short-group-name): * lisp/gnus/message.el (message-check-news-header-syntax) (message-make-message-id, message-user-mail-address) (message-make-fqdn, message-get-reply-headers, message-followup): * lisp/gnus/mm-decode.el (mm-dissect-buffer): * lisp/gnus/nnheader.el (nnheader-insert): * lisp/gnus/nnimap.el (nnimap-process-quirk) (nnimap-imap-ranges-to-gnus-ranges): * lisp/gnus/nnmaildir.el (nnmaildir--ensure-suffix): * lisp/gnus/nnmairix.el (nnmairix-determine-original-group-from-path): * lisp/gnus/nnrss.el (nnrss-match-macro): * lisp/gnus/nntp.el (nntp-find-group-and-number): * lisp/help-fns.el (help--symbol-completion-table-affixation): * lisp/help.el (help-function-arglist): * lisp/hippie-exp.el (he-concat-directory-file-name): * lisp/htmlfontify.el (hfy-relstub): * lisp/ido.el (ido-make-prompt, ido-complete, ido-copy-current-word) (ido-exhibit): * lisp/image/image-converter.el (image-convert-p): * lisp/info-xref.el (info-xref-docstrings): * lisp/info.el (Info-toc-build, Info-follow-reference) (Info-backward-node, Info-finder-find-node) (Info-speedbar-expand-node): * lisp/international/mule-diag.el (print-fontset-element): * lisp/language/korea-util.el (default-korean-keyboard): * lisp/linum.el (linum-after-change): * lisp/mail/ietf-drums.el (ietf-drums-parse-address): * lisp/mail/mail-utils.el (mail-dont-reply-to): * lisp/mail/rfc2047.el (rfc2047-encode-1, rfc2047-decode-string): * lisp/mail/rfc2231.el (rfc2231-parse-string): * lisp/mail/rmailkwd.el (rmail-set-label): * lisp/mail/rmailsum.el (rmail-header-summary): * lisp/mail/smtpmail.el (smtpmail-maybe-append-domain) (smtpmail-user-mail-address): * lisp/mail/uce.el (uce-reply-to-uce): * lisp/man.el (Man-default-man-entry): * lisp/mh-e/mh-alias.el (mh-alias-gecos-name) (mh-alias-minibuffer-confirm-address): * lisp/mh-e/mh-comp.el (mh-forwarded-letter-subject): * lisp/mh-e/mh-speed.el (mh-speed-parse-flists-output): * lisp/mh-e/mh-utils.el (mh-collect-folder-names-filter) (mh-folder-completion-function): * lisp/minibuffer.el (completion--make-envvar-table) (completion-file-name-table, completion-flex-try-completion) (completion-flex-all-completions): * lisp/mpc.el (mpc--proc-quote-string, mpc-cmd-special-tag-p) (mpc-constraints-tag-lookup): * lisp/net/ange-ftp.el (ange-ftp-send-cmd) (ange-ftp-allow-child-lookup): * lisp/net/mailcap.el (mailcap-mime-types): * lisp/net/mairix.el (mairix-search-thread-this-article): * lisp/net/pop3.el (pop3-open-server): * lisp/net/soap-client.el (soap-decode-xs-complex-type): * lisp/net/socks.el (socks-filter): * lisp/nxml/nxml-outln.el (nxml-highlighted-qname): * lisp/nxml/rng-cmpct.el (rng-c-expand-name, rng-c-expand-datatype): * lisp/nxml/rng-uri.el (rng-uri-file-name-1): * lisp/obsolete/complete.el (partial-completion-mode) (PC-do-completion): * lisp/obsolete/longlines.el (longlines-encode-string): * lisp/obsolete/nnir.el (nnir-compose-result): * lisp/obsolete/terminal.el (te-quote-arg-for-sh): * lisp/obsolete/tpu-edt.el (tpu-check-search-case): * lisp/obsolete/url-ns.el (isPlainHostName): * lisp/pcmpl-unix.el (pcomplete/scp): * lisp/play/dunnet.el (dun-listify-string2, dun-get-path) (dun-unix-parse, dun-doassign, dun-cat, dun-batch-unix-interface): * lisp/progmodes/ebnf2ps.el: (ebnf-eps-header-footer-comment): * lisp/progmodes/gdb-mi.el (gdb-var-delete) (gdb-speedbar-expand-node, gdbmi-bnf-incomplete-record-result): * lisp/progmodes/gud.el (gud-find-expr): * lisp/progmodes/idlw-help.el (idlwave-do-context-help1): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode) (idlwave-shell-filter-hidden-output, idlwave-shell-filter): * lisp/progmodes/idlwave.el (idlwave-skip-label-or-case) (idlwave-routine-info): * lisp/progmodes/octave.el (inferior-octave-completion-at-point): * lisp/progmodes/sh-script.el (sh-add-completer): * lisp/progmodes/sql.el (defun): * lisp/progmodes/xscheme.el (xscheme-process-filter): * lisp/replace.el (query-replace-compile-replacement) (map-query-replace-regexp): * lisp/shell.el (shell--command-completion-data) (shell-environment-variable-completion): * lisp/simple.el (display-message-or-buffer): * lisp/speedbar.el (speedbar-dired, speedbar-tag-file) (speedbar-tag-expand): * lisp/subr.el (split-string-and-unquote): * lisp/tar-mode.el (tar-extract): * lisp/term.el (term-command-hook, serial-read-name): * lisp/textmodes/bibtex.el (bibtex-print-help-message): * lisp/textmodes/ispell.el (ispell-lookup-words, ispell-filter) (ispell-parse-output, ispell-buffer-local-parsing): * lisp/textmodes/reftex-cite.el (reftex-do-citation): * lisp/textmodes/reftex-parse.el (reftex-notice-new): * lisp/textmodes/reftex-ref.el (reftex-show-entry): * lisp/textmodes/reftex.el (reftex-compile-variables): * lisp/textmodes/tex-mode.el (tex-send-command) (tex-start-tex, tex-append): * lisp/thingatpt.el (thing-at-point-url-at-point): * lisp/tmm.el (tmm-add-one-shortcut): * lisp/transient.el (transient-format-key): * lisp/url/url-auth.el (url-basic-auth) (url-digest-auth-directory-id-assoc): * lisp/url/url-news.el (url-news): * lisp/url/url-util.el (url-parse-query-string): * lisp/vc/vc-cvs.el (vc-cvs-parse-entry): * lisp/wid-browse.el (widget-browse-sexp): * lisp/woman.el (woman-parse-colon-path, woman-mini-help) (WoMan-getpage-in-background, woman-negative-vertical-space): * lisp/xml.el: * test/lisp/emacs-lisp/check-declare-tests.el (check-declare-tests-warn): * test/lisp/files-tests.el (files-tests-file-name-non-special-dired-compress-handler): * test/lisp/net/network-stream-tests.el (server-process-filter): * test/src/coding-tests.el (ert-test-unibyte-buffer-dos-eol-decode): Use `string-search` instead of `string-match` and `string-match-p`.
2021-08-09 09:20:00 +00:00
((not (string-search "%" fstring))
1997-04-16 22:13:18 +00:00
(list fstring))
;; A format string with just a single string spec.
((string= fstring "%s")
(list (car flist)))
;; A single character.
((string= fstring "%c")
(list (car flist)))
;; A single number.
((string= fstring "%d")
(setq dontinsert t)
1997-04-16 22:13:18 +00:00
(if insert
`(insert (int-to-string ,(car flist)))
1997-04-16 22:13:18 +00:00
(list `(int-to-string ,(car flist)))))
;; Just lots of chars and strings.
((string-match "\\`\\(%[cs]\\)+\\'" fstring)
(nreverse flist))
;; A single string spec at the beginning of the spec.
((string-match "\\`%[sc][^%]+\\'" fstring)
(list (car flist) (substring fstring 2)))
;; A single string spec in the middle of the spec.
((string-match "\\`\\([^%]+\\)%[sc]\\([^%]+\\)\\'" fstring)
(list (match-string 1 fstring) (car flist) (match-string 2 fstring)))
;; A single string spec in the end of the spec.
((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring)
(list (match-string 1 fstring) (car flist)))
;; A more complex spec.
(t
(list (cons 'format (cons fstring (nreverse flist)))))))
(if insert
(when result
(if dontinsert
result
(cons 'insert result)))
(cond ((stringp result)
result)
((consp result)
(cons 'concat result))
(t "")))))
(defun gnus-eval-format (format &optional alist props)
"Eval the format variable FORMAT, using ALIST.
If PROPS, insert the result."
(let ((form (gnus-parse-format format alist props)))
(if props
* lisp/gnus: Use lexical-binding in all the files * lisp/gnus/gnus-group.el (features): Use `dlet`. (gnus-tmp-level, gnus-tmp-marked, gnus-tmp-group): Declare vars. (gnus-group-insert-group-line): Bind dynbound vars via `let` rather than as formal args. Bind `number` as dynbound. (gnus-visual, gnus-score-find-score-files-function) (gnus-home-score-file, gnus-apply-kill-hook) (gnus-summary-expunge-below): Declare vars. (gnus-group-restart, gnus-group-list-plus): Fix `interactive` spec since the arg is unused. * lisp/gnus/mail-source.el (mail-source-bind, mail-source-bind-common): Use `dlet` and suppress the warnings about the non-prefixed dynbound vars. (mail-source-set-1): Remove unused var `auth-info`. (mail-source-call-script): Remove unused var `background`. (mail-source-fetch-pop, mail-source-check-pop): Bind pop3 vars with `dlet`. * lisp/gnus/gnus-int.el (mail-source-plugged, gnus-inhibit-demon): Declare vars. (gnus-server-opened, gnus-status-message) (gnus-open-server, gnus-close-server, gnus-request-list) (gnus-finish-retrieve-group-infos, gnus-retrieve-group-data-early) (gnus-request-list-newsgroups, gnus-request-newgroups) (gnus-request-regenerate, gnus-request-compact, gnus-request-group) (gnus-retrieve-groups, gnus-request-post, gnus-request-expunge-group) (gnus-request-scan, gnus-request-update-info, gnus-request-marks) (gnus-request-accept-article, gnus-request-create-group) (gnus-asynchronous-p, gnus-remove-denial): Bind `gnus-command-method` via `let` rather than as formal args. * lisp/gnus/gnus-topic.el (gnus-topic-insert-topic-line): Pass documented vars to eval for `gnus-topic-line-format-spec`. * lisp/gnus/message.el (message-yank-original): Use `cl-progv` rather than `eval` to bind the vars from `message-cite-style`. * lisp/gnus/mml.el (mml-parse-1): Use `apply` instead of `eval`. (gnus-newsgroup-name, gnus-displaying-mime, gnus-newsgroup-name) (gnus-article-prepare-hook, gnus-newsgroup-charset) (gnus-original-article-buffer, gnus-message-buffer) (message-this-is-news, message-this-is-mail): Declare vars. * lisp/gnus/deuglify.el (gnus-outlook-rearrange-article): Remove unused var `cite-marks`. * lisp/gnus/gnus-art.el (ansi-color-context-region): Declare var. (gnus-mime-display-attachment-buttons-in-header): Move declaration before first use. (gnus-mime-display-alternative): Remove unused var `from`. * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-list): Remove unused var `start` `end`. * lisp/gnus/gnus-cache.el (gnus-article-decode-hook) (nnml-generate-active-function): Declare var. * lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Remove unused var `keywords`. * lisp/gnus/gnus-cloud.el (gnus-cloud-encode-data): Remove unused var `cipher`. (gnus-cloud-ensure-cloud-group): Remove unused var `method`. * lisp/gnus/gnus-delay.el (gnus-delay-article): Remove unused var `days`. * lisp/gnus/gnus-html.el (gnus-html-wash-images): Remove unused vars `tag`, `string`, and `images`. (gnus-html-wash-tags): Remove unused vars `string` and `images`. * lisp/gnus/gnus-msg.el (gnus-msg-mail): Remove unused var `group-name`. (gnus-group-mail, gnus-group-news, gnus-summary-mail-other-window) (gnus-summary-news-other-window): Remove unused vars `group` and `buffer`. (gnus-configure-posting-styles): Remove unused vars `style` and `attribute`. * lisp/gnus/gnus-picon.el (gnus-picon-find-face): Remove unused vars `database`, `directory`, and `instance`. (gnus-picon-transform-newsgroups): Remove unused var `point`. * lisp/gnus/gnus-range.el (gnus-range-difference): Remove unused var `safe`. * lisp/gnus/gnus-score.el (gnus-score-load-file): Remove unused var `score-fn`. * lisp/gnus/gnus-sum.el (message-options-set-recipient): Declare var. * lisp/gnus/gnus-undo.el (gnus-undo): Fix docstring lie. * lisp/gnus/gnus-util.el (print-string-length) (iswitchb-make-buflist-hook): Declare vars. (gnus-emacs-version): Remove unused var `codename`. (gnus-rename-file): Remove unused vars `old-name` and `new-name`. * lisp/gnus/gnus-uu.el (gnus-uu-yenc-article): Remove unused var `start-char`. (gnus-asynchronous): Declare var. * lisp/gnus/mm-partial.el (gnus-displaying-mime): Declare var. (mm-inline-partial): Remove unused var `buffer`. * lisp/gnus/mm-view.el (w3m-force-redisplay, w3m-safe-url-regexp) (gnus-displaying-mime, gnus-original-article-buffer) (gnus-article-prepare-hook): Declare vars. * lisp/gnus/mml-smime.el (mml-smime-epg-encrypt): Remove unused var `boundary`. (mml-smime-epg-verify): Remove unused vars `plain` and `signature-file`. * lisp/gnus/mml1991.el (pgg-text-mode): Declare var. * lisp/gnus/mml2015.el (pgg-text-mode): Declare var. (mml2015-pgg-decrypt): Remove unused var `result`. (mml2015-epg-key-image-to-string): Remove unused var `error`. (mml2015-epg-decrypt): Remove unused var `result`. (mml2015-epg-verify): Remove unused vars `plain` and `signature-file`. * lisp/gnus/nnbabyl.el (nnml-current-directory): Declare var. * lisp/gnus/nndiary.el (nndiary-files): Move declaration before first use. * lisp/gnus/nnfolder.el (nnfolder-request-accept-article): Remove unused var `buf`. * lisp/gnus/nnmail.el (nnmail-parse-active): Remove unused var `err`. * lisp/gnus/nnmairix.el (nnmairix-request-group): Remove unused var `args`. (nnmairix-request-create-group): Remove unused var `info`. (nnmairix-request-list): Remove unused var `folder`. (nnmairix-request-set-mark): Remove unused var `propto`. (nnmairix-request-set-mark): Remove unused vars `number` and `method`. (nnmairix-close-group): Remove unused var `method`. (nnmairix-create-search-group-from-message): Remove unused var `cq`. (nnmairix-create-server-and-default-group): Remove unused var `create`. (nnmairix-purge-old-groups): Remove unused var `folder`. (nnmairix-remove-tick-mark-original-article, nnmairix-get-valid-servers): Remove unused var `cur`. (nnmairix-replace-group-and-numbers): Remove unused var `header`. (nnmairix-goto-original-article): Remove unused var `rval`. (nnmairix-widget-create-query): Remove unused var `allwidgets`. * lisp/gnus/nnmbox.el (nnml-current-directory): Declare var. * lisp/gnus/nnmh.el (nnmh-toplev): Move declaration before first use. (nnmh-request-list-1): Remove unused var `rdir`. * lisp/gnus/nnml.el (nnml-generate-nov-file): Remove unused var `file`. * lisp/gnus/nnrss.el (nnrss-request-article): Remove unused var `post`. (nnrss-request-article): Remove unused var `fn`. (nnrss-check-group): Remove unused var `rdf-ns`. * lisp/gnus/nnweb.el (nnweb-request-article): Remove unused var `active`. (nnweb-google-parse-1): Remove unused var `Score`. * lisp/gnus/spam-stat.el (spam-stat-error-holder): Remove var. (spam-stat-buffer-words-with-scores): Remove unused var `word`. (spam-stat-score-buffer): Remove unused var `spam-stat-error-holder`. (spam-stat-split-fancy): Use `err` instead of `spam-stat-error-holder`. * lisp/gnus/spam-wash.el (spam-wash): Remove unused var `handle`. * lisp/gnus/spam.el (spam-copy-or-move-routine): Remove unused vars `article` and `mark`. (spam-register-routine): Remove unused var `article`. (spam-log-undo-registration): Remove unused var `found`. (spam-ifile-register-with-ifile): Remove unused var `parameters`. (spam-check-stat): Remove unused vars `category` and `return`. (spam-parse-list): Remove unused var `found`. (spam-filelist-register-routine): Remove unused var `from`.
2021-01-30 23:44:00 +00:00
(add-text-properties (point) (progn (eval form t) (point)) props)
(eval form t))))
1997-04-16 22:13:18 +00:00
1999-02-20 14:05:57 +00:00
(defun gnus-set-format (type &optional insertable)
(set (intern (format "gnus-%s-line-format-spec" type))
(gnus-parse-format
(symbol-value (intern (format "gnus-%s-line-format" type)))
(symbol-value (intern (format "gnus-%s-line-format-alist" type)))
insertable)))
(defun gnus-summary-line-format-spec ()
(insert gnus-tmp-unread gnus-tmp-replied
gnus-tmp-score-char gnus-tmp-indentation)
(put-text-property
(point)
(progn
(insert
gnus-tmp-opening-bracket
(format "%4d: %-20s"
gnus-tmp-lines
(if (> (length gnus-tmp-name) 20)
(truncate-string-to-width gnus-tmp-name 20)
gnus-tmp-name))
gnus-tmp-closing-bracket)
(point))
'mouse-face gnus-mouse-face)
(insert " " gnus-tmp-subject-or-nil "\n"))
1997-04-16 22:13:18 +00:00
(provide 'gnus-spec)
;; Local Variables:
;; coding: utf-8
;; End:
1997-04-16 22:13:18 +00:00
;;; gnus-spec.el ends here