comparison lisp/gnus/gnus-util.el @ 18:d95e72db5c07 r19-15b92

Import from CVS: tag r19-15b92
author cvs
date Mon, 13 Aug 2007 08:49:43 +0200
parents 0293115a14e9
children 8fc7fe29b841
comparison
equal deleted inserted replaced
17:4579af9d8826 18:d95e72db5c07
27 ;; functions and macros in this file are utility functions that are 27 ;; functions and macros in this file are utility functions that are
28 ;; used by Gnus and may be used by any other package without loading 28 ;; used by Gnus and may be used by any other package without loading
29 ;; Gnus first. 29 ;; Gnus first.
30 30
31 ;;; Code: 31 ;;; Code:
32
33 ;(if (fboundp 'point-at-bol)
34 ; (fset 'gnus-point-at-bol 'point-at-bol)
35 ; (defsubst gnus-point-at-bol ()
36 ; "Return point at the beginning of the line."
37 ; (let ((p (point)))
38 ; (beginning-of-line)
39 ; (prog1
40 ; (point)
41 ; (goto-char p)))))
42
43 ;(if (fboundp 'point-at-eol)
44 ; (fset 'gnus-point-at-eol 'point-at-eol)
45 ; (defsubst gnus-point-at-eol ()
46 ; "Return point at the end of the line."
47 ; (let ((p (point)))
48 ; (end-of-line)
49 ; (prog1
50 ; (point)
51 ; (goto-char p)))))
52 32
53 (require 'custom) 33 (require 'custom)
54 (require 'cl) 34 (require 'cl)
55 (require 'nnheader) 35 (require 'nnheader)
56 (require 'timezone) 36 (require 'timezone)
119 99
120 (defmacro gnus-kill-buffer (buffer) 100 (defmacro gnus-kill-buffer (buffer)
121 `(let ((buf ,buffer)) 101 `(let ((buf ,buffer))
122 (when (gnus-buffer-exists-p buf) 102 (when (gnus-buffer-exists-p buf)
123 (kill-buffer buf)))) 103 (kill-buffer buf))))
104
105 (if (fboundp 'point-at-bol)
106 (fset 'gnus-point-at-bol 'point-at-bol)
107 (defun gnus-point-at-bol ()
108 "Return point at the beginning of the line."
109 (let ((p (point)))
110 (beginning-of-line)
111 (prog1
112 (point)
113 (goto-char p)))))
114
115 (if (fboundp 'point-at-eol)
116 (fset 'gnus-point-at-eol 'point-at-eol)
117 (defun gnus-point-at-eol ()
118 "Return point at the end of the line."
119 (let ((p (point)))
120 (end-of-line)
121 (prog1
122 (point)
123 (goto-char p)))))
124 124
125 (defun gnus-delete-first (elt list) 125 (defun gnus-delete-first (elt list)
126 "Delete by side effect the first occurrence of ELT as a member of LIST." 126 "Delete by side effect the first occurrence of ELT as a member of LIST."
127 (if (equal (car list) elt) 127 (if (equal (car list) elt)
128 (cdr list) 128 (cdr list)
188 (nnheader-narrow-to-headers) 188 (nnheader-narrow-to-headers)
189 (message-fetch-field field))))) 189 (message-fetch-field field)))))
190 190
191 (defun gnus-goto-colon () 191 (defun gnus-goto-colon ()
192 (beginning-of-line) 192 (beginning-of-line)
193 (search-forward ":" (point-at-eol) t)) 193 (search-forward ":" (gnus-point-at-eol) t))
194 194
195 (defun gnus-remove-text-with-property (prop) 195 (defun gnus-remove-text-with-property (prop)
196 "Delete all text in the current buffer with text property PROP." 196 "Delete all text in the current buffer with text property PROP."
197 (save-excursion 197 (save-excursion
198 (goto-char (point-min)) 198 (goto-char (point-min))