diff options
| author | Juanma Barranquero | 2005-09-13 08:47:44 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2005-09-13 08:47:44 +0000 |
| commit | e77274b76e31b293b0f9e1af79fafc68220e374b (patch) | |
| tree | 6d81d03e2a6a4eb58df9f168246bc3597b1c8f71 | |
| parent | e5b05b08c1b1485246447dafab544a505238fdda (diff) | |
| download | emacs-e77274b76e31b293b0f9e1af79fafc68220e374b.tar.gz emacs-e77274b76e31b293b0f9e1af79fafc68220e374b.zip | |
(tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
| -rw-r--r-- | lisp/net/newsticker.el | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el index a0ada95503d..4f73934a7db 100644 --- a/lisp/net/newsticker.el +++ b/lisp/net/newsticker.el | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | ;; Created: 17. June 2003 | 10 | ;; Created: 17. June 2003 |
| 11 | ;; Keywords: News, RSS | 11 | ;; Keywords: News, RSS |
| 12 | ;; Time-stamp: "26. August 2005, 16:33:46 (ulf)" | 12 | ;; Time-stamp: "26. August 2005, 16:33:46 (ulf)" |
| 13 | ;; CVS-Version: $Id: newsticker.el,v 1.1 2005/09/12 15:30:19 rms Exp $ | 13 | ;; CVS-Version: $Id: newsticker.el,v 1.2 2005/09/12 22:54:28 miles Exp $ |
| 14 | 14 | ||
| 15 | (defconst newsticker-version "1.8" "Version number of newsticker.el.") | 15 | (defconst newsticker-version "1.8" "Version number of newsticker.el.") |
| 16 | 16 | ||
| @@ -86,7 +86,7 @@ | |||
| 86 | ;; following. | 86 | ;; following. |
| 87 | ;; (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index) | 87 | ;; (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index) |
| 88 | 88 | ||
| 89 | ;; That's it. | 89 | ;; That's it. |
| 90 | 90 | ||
| 91 | ;; Usage | 91 | ;; Usage |
| 92 | ;; ----- | 92 | ;; ----- |
| @@ -353,6 +353,11 @@ | |||
| 353 | (require 'derived) | 353 | (require 'derived) |
| 354 | (require 'xml) | 354 | (require 'xml) |
| 355 | 355 | ||
| 356 | ;; Silence warnings | ||
| 357 | (defvar tool-bar-map) | ||
| 358 | (defvar w3-mode-map) | ||
| 359 | (defvar w3m-minor-mode-map) | ||
| 360 | |||
| 356 | ;; ====================================================================== | 361 | ;; ====================================================================== |
| 357 | ;;; Customizables | 362 | ;;; Customizables |
| 358 | ;; ====================================================================== | 363 | ;; ====================================================================== |
| @@ -967,7 +972,7 @@ If t the echo area will not show immortal items. See also | |||
| 967 | :type 'boolean | 972 | :type 'boolean |
| 968 | :set 'newsticker--set-customvar | 973 | :set 'newsticker--set-customvar |
| 969 | :group 'newsticker-ticker) | 974 | :group 'newsticker-ticker) |
| 970 | 975 | ||
| 971 | (defcustom newsticker-hide-old-items-in-echo-area | 976 | (defcustom newsticker-hide-old-items-in-echo-area |
| 972 | t | 977 | t |
| 973 | "Decides whether to show only the newest news items in the ticker. | 978 | "Decides whether to show only the newest news items in the ticker. |
| @@ -2368,7 +2373,7 @@ running already." | |||
| 2368 | (run-at-time newsticker-display-interval | 2373 | (run-at-time newsticker-display-interval |
| 2369 | newsticker-display-interval | 2374 | newsticker-display-interval |
| 2370 | 'newsticker--display-tick)))) | 2375 | 'newsticker--display-tick)))) |
| 2371 | 2376 | ||
| 2372 | (defun newsticker-stop () | 2377 | (defun newsticker-stop () |
| 2373 | "Stop the newsticker and the newsticker-ticker. | 2378 | "Stop the newsticker and the newsticker-ticker. |
| 2374 | Cancel the timers for display and retrieval. Run `newsticker-stop-hook' | 2379 | Cancel the timers for display and retrieval. Run `newsticker-stop-hook' |
| @@ -2429,7 +2434,7 @@ Unless FORCE is t this is donly only if necessary, i.e. when the | |||
| 2429 | ;; Emacs 21.3.50 does not care if we turn off auto-fill in the | 2434 | ;; Emacs 21.3.50 does not care if we turn off auto-fill in the |
| 2430 | ;; definition of newsticker-mode, so we do it here (again) | 2435 | ;; definition of newsticker-mode, so we do it here (again) |
| 2431 | (auto-fill-mode -1) | 2436 | (auto-fill-mode -1) |
| 2432 | 2437 | ||
| 2433 | (set-buffer-file-coding-system 'utf-8) | 2438 | (set-buffer-file-coding-system 'utf-8) |
| 2434 | 2439 | ||
| 2435 | (if newsticker-use-full-width | 2440 | (if newsticker-use-full-width |
| @@ -2521,7 +2526,7 @@ calls `w3m-toggle-inline-image'. It works only if | |||
| 2521 | (w3m-remove-image | 2526 | (w3m-remove-image |
| 2522 | pos (next-single-property-change pos 'w3m-image)) | 2527 | pos (next-single-property-change pos 'w3m-image)) |
| 2523 | (w3m-toggle-inline-image t)))))))))))) | 2528 | (w3m-toggle-inline-image t)))))))))))) |
| 2524 | 2529 | ||
| 2525 | ;; ====================================================================== | 2530 | ;; ====================================================================== |
| 2526 | ;;; keymap stuff | 2531 | ;;; keymap stuff |
| 2527 | ;; ====================================================================== | 2532 | ;; ====================================================================== |
| @@ -2789,7 +2794,7 @@ not get changed." | |||
| 2789 | (interactive) | 2794 | (interactive) |
| 2790 | (newsticker--buffer-hideshow 'desc-old nil) | 2795 | (newsticker--buffer-hideshow 'desc-old nil) |
| 2791 | (newsticker--buffer-redraw)) | 2796 | (newsticker--buffer-redraw)) |
| 2792 | 2797 | ||
| 2793 | (defun newsticker-show-old-item-desc () | 2798 | (defun newsticker-show-old-item-desc () |
| 2794 | "Show the description of old items." | 2799 | "Show the description of old items." |
| 2795 | (interactive) | 2800 | (interactive) |
| @@ -2863,7 +2868,7 @@ not get changed." | |||
| 2863 | "Hide description of entry at point." | 2868 | "Hide description of entry at point." |
| 2864 | (interactive) | 2869 | (interactive) |
| 2865 | (save-excursion | 2870 | (save-excursion |
| 2866 | (let* (pos1 pos2 | 2871 | (let* (pos1 pos2 |
| 2867 | (inhibit-read-only t) | 2872 | (inhibit-read-only t) |
| 2868 | inv-prop org-inv-prop | 2873 | inv-prop org-inv-prop |
| 2869 | is-invisible) | 2874 | is-invisible) |
| @@ -2890,7 +2895,7 @@ not get changed." | |||
| 2890 | "Show description of entry at point." | 2895 | "Show description of entry at point." |
| 2891 | (interactive) | 2896 | (interactive) |
| 2892 | (save-excursion | 2897 | (save-excursion |
| 2893 | (let* (pos1 pos2 | 2898 | (let* (pos1 pos2 |
| 2894 | (inhibit-read-only t) | 2899 | (inhibit-read-only t) |
| 2895 | inv-prop org-inv-prop | 2900 | inv-prop org-inv-prop |
| 2896 | is-invisible) | 2901 | is-invisible) |
| @@ -3049,7 +3054,7 @@ in an element of `newsticker-url-list' or `newsticker-url-list-defaults'." | |||
| 3049 | (set-process-coding-system proc 'no-conversion 'no-conversion) | 3054 | (set-process-coding-system proc 'no-conversion 'no-conversion) |
| 3050 | (set-process-sentinel proc 'newsticker--sentinel))))) | 3055 | (set-process-sentinel proc 'newsticker--sentinel))))) |
| 3051 | 3056 | ||
| 3052 | 3057 | ||
| 3053 | (defun newsticker-mouse-browse-url (event) | 3058 | (defun newsticker-mouse-browse-url (event) |
| 3054 | "Call `browse-url' for the link of the item at which the EVENT occurred." | 3059 | "Call `browse-url' for the link of the item at which the EVENT occurred." |
| 3055 | (interactive "e") | 3060 | (interactive "e") |
| @@ -3157,7 +3162,7 @@ Argument EVENT tells what has happened to the process." | |||
| 3157 | (let ((start (match-beginning 0))) | 3162 | (let ((start (match-beginning 0))) |
| 3158 | (unless (search-forward "-->" nil t) | 3163 | (unless (search-forward "-->" nil t) |
| 3159 | (error "Can't find end of comment")) | 3164 | (error "Can't find end of comment")) |
| 3160 | (delete-region start (point)))) | 3165 | (delete-region start (point)))) |
| 3161 | ;; And another one (20050702)! If description is HTML | 3166 | ;; And another one (20050702)! If description is HTML |
| 3162 | ;; encoded and starts with a `<', wrap the whole | 3167 | ;; encoded and starts with a `<', wrap the whole |
| 3163 | ;; description in a CDATA expression. This happened for | 3168 | ;; description in a CDATA expression. This happened for |
| @@ -3324,7 +3329,7 @@ Argument EVENT tells what has happened to the process." | |||
| 3324 | (guid (if (stringp tguid) | 3329 | (guid (if (stringp tguid) |
| 3325 | tguid | 3330 | tguid |
| 3326 | (car (xml-node-children tguid))))) | 3331 | (car (xml-node-children tguid))))) |
| 3327 | ;;(message "guid=%s" guid) | 3332 | ;;(message "guid=%s" guid) |
| 3328 | (setq old-item | 3333 | (setq old-item |
| 3329 | (newsticker--cache-contains newsticker--cache | 3334 | (newsticker--cache-contains newsticker--cache |
| 3330 | name-symbol title | 3335 | name-symbol title |
| @@ -3396,7 +3401,7 @@ Argument EVENT tells what has happened to the process." | |||
| 3396 | (when (and imageurl | 3401 | (when (and imageurl |
| 3397 | (string-match "%l" newsticker-heading-format)) | 3402 | (string-match "%l" newsticker-heading-format)) |
| 3398 | (newsticker--image-get name imageurl)))))) | 3403 | (newsticker--image-get name imageurl)))))) |
| 3399 | 3404 | ||
| 3400 | (defun newsticker--display-tick () | 3405 | (defun newsticker--display-tick () |
| 3401 | "Called from the display timer. | 3406 | "Called from the display timer. |
| 3402 | This function calls a display function, according to the variable | 3407 | This function calls a display function, according to the variable |
| @@ -3828,17 +3833,17 @@ Keeps order of feeds as given in `newsticker-url-list' and | |||
| 3828 | feed-name-symbol))) | 3833 | feed-name-symbol))) |
| 3829 | items) | 3834 | items) |
| 3830 | (put-text-property pos (point) 'feed (car feed)) | 3835 | (put-text-property pos (point) 'feed (car feed)) |
| 3831 | 3836 | ||
| 3832 | ;; insert empty line between feeds | 3837 | ;; insert empty line between feeds |
| 3833 | (let ((p (point))) | 3838 | (let ((p (point))) |
| 3834 | (insert "\n") | 3839 | (insert "\n") |
| 3835 | (put-text-property p (point) 'hard t))))) | 3840 | (put-text-property p (point) 'hard t))))) |
| 3836 | (append newsticker-url-list newsticker-url-list-defaults)) | 3841 | (append newsticker-url-list newsticker-url-list-defaults)) |
| 3837 | 3842 | ||
| 3838 | (newsticker--buffer-set-faces (point-min) (point-max)) | 3843 | (newsticker--buffer-set-faces (point-min) (point-max)) |
| 3839 | (newsticker--buffer-set-invisibility (point-min) (point-max)) | 3844 | (newsticker--buffer-set-invisibility (point-min) (point-max)) |
| 3840 | (goto-char (point-min))) | 3845 | (goto-char (point-min))) |
| 3841 | 3846 | ||
| 3842 | (defun newsticker--buffer-insert-item (item &optional feed-name-symbol) | 3847 | (defun newsticker--buffer-insert-item (item &optional feed-name-symbol) |
| 3843 | "Insert a news item in the current buffer. | 3848 | "Insert a news item in the current buffer. |
| 3844 | Insert the string PREFIX and a formatted representation of the | 3849 | Insert the string PREFIX and a formatted representation of the |
| @@ -3889,7 +3894,7 @@ FEED-NAME-SYMBOL tells to which feed this item belongs." | |||
| 3889 | (setq format newsticker-item-format) | 3894 | (setq format newsticker-item-format) |
| 3890 | (if (eq type 'feed) | 3895 | (if (eq type 'feed) |
| 3891 | (setq format newsticker-heading-format))) | 3896 | (setq format newsticker-heading-format))) |
| 3892 | 3897 | ||
| 3893 | (while (> (length format) 0) | 3898 | (while (> (length format) 0) |
| 3894 | (let ((prefix (if (> (length format) 1) | 3899 | (let ((prefix (if (> (length format) 1) |
| 3895 | (substring format 0 2) | 3900 | (substring format 0 2) |
| @@ -3971,7 +3976,7 @@ FEED-NAME-SYMBOL tells to which feed this item belongs." | |||
| 3971 | ;; in case that the format string contained newlines | 3976 | ;; in case that the format string contained newlines |
| 3972 | (put-text-property p (point) 'hard t)) | 3977 | (put-text-property p (point) 'hard t)) |
| 3973 | (setq format (substring format (match-beginning 2))))))) | 3978 | (setq format (substring format (match-beginning 2))))))) |
| 3974 | 3979 | ||
| 3975 | ;; decode HTML if possible... | 3980 | ;; decode HTML if possible... |
| 3976 | (let ((is-rendered-HTML nil)) | 3981 | (let ((is-rendered-HTML nil)) |
| 3977 | (when (and newsticker-html-renderer pos-text-start pos-text-end) | 3982 | (when (and newsticker-html-renderer pos-text-start pos-text-end) |
| @@ -3990,8 +3995,6 @@ FEED-NAME-SYMBOL tells to which feed this item belongs." | |||
| 3990 | (save-excursion | 3995 | (save-excursion |
| 3991 | (funcall newsticker-html-renderer pos-text-start | 3996 | (funcall newsticker-html-renderer pos-text-start |
| 3992 | pos-text-end))) | 3997 | pos-text-end))) |
| 3993 | ;; FIXME: compiler warning about free variable | ||
| 3994 | ;; w3m-minor-mode-map | ||
| 3995 | (cond ((eq newsticker-html-renderer 'w3m-region) | 3998 | (cond ((eq newsticker-html-renderer 'w3m-region) |
| 3996 | (add-text-properties pos (point-max) | 3999 | (add-text-properties pos (point-max) |
| 3997 | (list 'keymap | 4000 | (list 'keymap |
| @@ -4060,7 +4063,7 @@ FEED-NAME-SYMBOL tells to which feed this item belongs." | |||
| 4060 | (add-text-properties pos (point) | 4063 | (add-text-properties pos (point) |
| 4061 | (list 'nt-title (newsticker--title item) | 4064 | (list 'nt-title (newsticker--title item) |
| 4062 | 'nt-desc (newsticker--desc item)))) | 4065 | 'nt-desc (newsticker--desc item)))) |
| 4063 | 4066 | ||
| 4064 | (add-text-properties pos (point) | 4067 | (add-text-properties pos (point) |
| 4065 | (list 'nt-type type | 4068 | (list 'nt-type type |
| 4066 | 'nt-face type | 4069 | 'nt-face type |
| @@ -4083,7 +4086,7 @@ FEED-NAME-SYMBOL tells to which feed this item belongs." | |||
| 4083 | ;; left margin | 4086 | ;; left margin |
| 4084 | ;;(unless (memq type '(feed item)) | 4087 | ;;(unless (memq type '(feed item)) |
| 4085 | ;;(set-left-margin pos (1- (point)) 1)) | 4088 | ;;(set-left-margin pos (1- (point)) 1)) |
| 4086 | 4089 | ||
| 4087 | ;; save rendered stuff | 4090 | ;; save rendered stuff |
| 4088 | (cond ((eq type 'desc) | 4091 | (cond ((eq type 'desc) |
| 4089 | ;; preformatted contents | 4092 | ;; preformatted contents |
| @@ -4201,8 +4204,8 @@ property to '(<nt-type>-<nt-age> <nt-type> <nt-age>)." | |||
| 4201 | (put-text-property (max (point-min) pos1) (1- pos2) | 4204 | (put-text-property (max (point-min) pos1) (1- pos2) |
| 4202 | 'invisible | 4205 | 'invisible |
| 4203 | (list (intern | 4206 | (list (intern |
| 4204 | (concat | 4207 | (concat |
| 4205 | (symbol-name | 4208 | (symbol-name |
| 4206 | (if (eq nt-type 'extra) 'desc nt-type)) | 4209 | (if (eq nt-type 'extra) 'desc nt-type)) |
| 4207 | "-" | 4210 | "-" |
| 4208 | (symbol-name nt-age))) | 4211 | (symbol-name nt-age))) |
| @@ -4218,8 +4221,8 @@ property to '(<nt-type>-<nt-age> <nt-type> <nt-age>)." | |||
| 4218 | (put-text-property (1- pos1) (1- pos2) | 4221 | (put-text-property (1- pos1) (1- pos2) |
| 4219 | 'invisible | 4222 | 'invisible |
| 4220 | (list (intern | 4223 | (list (intern |
| 4221 | (concat | 4224 | (concat |
| 4222 | (symbol-name | 4225 | (symbol-name |
| 4223 | (if (eq nt-type 'extra) 'desc nt-type)) | 4226 | (if (eq nt-type 'extra) 'desc nt-type)) |
| 4224 | "-" | 4227 | "-" |
| 4225 | (symbol-name nt-age))) | 4228 | (symbol-name nt-age))) |
| @@ -4253,7 +4256,7 @@ The face is chosen according the values of NT-FACE and AGE." | |||
| 4253 | 'newsticker-enclosure-face)))) | 4256 | 'newsticker-enclosure-face)))) |
| 4254 | (when face | 4257 | (when face |
| 4255 | (put-text-property pos1 (max pos1 pos2) 'face face)))) | 4258 | (put-text-property pos1 (max pos1 pos2) 'face face)))) |
| 4256 | 4259 | ||
| 4257 | (defun newsticker--insert-image (img string) | 4260 | (defun newsticker--insert-image (img string) |
| 4258 | "Insert IMG with STRING at point. | 4261 | "Insert IMG with STRING at point. |
| 4259 | This is a work-around for a strange behavior of Emacs versions before | 4262 | This is a work-around for a strange behavior of Emacs versions before |
| @@ -4528,7 +4531,7 @@ older than TIME." | |||
| 4528 | (newsticker--debug-msg | 4531 | (newsticker--debug-msg |
| 4529 | "Item `%s' from %s has expired on %s" | 4532 | "Item `%s' from %s has expired on %s" |
| 4530 | (newsticker--title item) | 4533 | (newsticker--title item) |
| 4531 | (format-time-string "%Y-%02m-%d, %H:%M" | 4534 | (format-time-string "%Y-%02m-%d, %H:%M" |
| 4532 | (newsticker--time item)) | 4535 | (newsticker--time item)) |
| 4533 | (format-time-string "%Y-%02m-%d, %H:%M" exp-time)) | 4536 | (format-time-string "%Y-%02m-%d, %H:%M" exp-time)) |
| 4534 | (setcar (nthcdr 4 item) new-age))))) | 4537 | (setcar (nthcdr 4 item) new-age))))) |
| @@ -4746,7 +4749,7 @@ well." | |||
| 4746 | (setcdr feed-list (sort (cdr feed-list) | 4749 | (setcdr feed-list (sort (cdr feed-list) |
| 4747 | sort-fun))) | 4750 | sort-fun))) |
| 4748 | newsticker--cache))) | 4751 | newsticker--cache))) |
| 4749 | 4752 | ||
| 4750 | (defun newsticker--cache-update (&optional save) | 4753 | (defun newsticker--cache-update (&optional save) |
| 4751 | "Update newsticker cache file. | 4754 | "Update newsticker cache file. |
| 4752 | If optional argument SAVE is not nil the cache file is saved to disk." | 4755 | If optional argument SAVE is not nil the cache file is saved to disk." |
| @@ -4832,7 +4835,7 @@ Export subscriptions to a buffer in OPML Format." | |||
| 4832 | (list name url nil nil nil) t))) | 4835 | (list name url nil nil nil) t))) |
| 4833 | outlines)) | 4836 | outlines)) |
| 4834 | (customize-variable 'newsticker-url-list)) | 4837 | (customize-variable 'newsticker-url-list)) |
| 4835 | 4838 | ||
| 4836 | ;; ====================================================================== | 4839 | ;; ====================================================================== |
| 4837 | ;;; Auto marking | 4840 | ;;; Auto marking |
| 4838 | ;; ====================================================================== | 4841 | ;; ====================================================================== |