annotate lisp/emacs-lisp/gulp.el @ 83004:7900111db01c

Converted display hooks to be display-local. Plus many bugfixes. lib-src/emacsclient.c (window_change_signal): Renamed to pass_signal_to_emacs. (init_signal): Pass SIGINT and SIGQUIT to the emacs process. lisp/faces.el (face-valid-attribute-values): Use the window-system function, not the variable. (read-face-attribute, face-spec-set-match-display, frame-set-background-mode) (face-set-after-frame-default): Ditto. lisp/frame.el (make-frame-on-tty): Added interactive declaration (suggested by Robert J. Chassell). Use tty-create-frame-with-faces, not make-terminal-frame. src/termhooks.h (struct display_method): Renamed to display for brevity. (struct display): Added all display hook variables as members of this structure. Added next_display, reference_count, type and display_info components. (FRAME_MUST_WRITE_SPACES, FRAME_FAST_CLEAR_END_OF_LINE, FRAME_LINE_INS_DEL_OK) (FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK, FRAME_SCROLL_REGION_COST) (FRAME_MEMORY_BELOW_FRAME, FRAME_RIF): Updated for struct display. (FRAME_DISPLAY): New macro. (create_display, delete_display): New prototypes. src/frame.h (struct frame): Added `display' member, removed display_method. (FRAME_LIVE_P): Look at f->display, not f->output_data. src/termchar.h (struct tty_display_info): Removed display_method component. (FRAME_TTY): Use the display structure, not output_data. src/term.c (display_list): New variable. (cursor_to_hook, raw_cursor_to_hook, clear_to_end_hook, clear_frame_hook) (clear_end_of_line_hook, ins_del_lines_hook, delete_glyphs_hook) (ring_bell_hook, reset_terminal_modes_hook, set_terminal_modes_hook) (update_begin_hook, update_end_hook, set_terminal_window_hook) (insert_glyphs_hook, write_glyphs_hook, delete_glyphs_hoo, read_socket_hook) (frame_up_to_date_hook, mouse_position_hook, frame_rehighlight_hook) (frame_raise_lower_hook, set_vertical_scroll_bar_hook, condemn_scroll_bars_hook) (redeem_scroll_bar_hook, judge_scroll_bars_hook): Moved to struct display. (tty_display_method_template): Removed. (syms_of_term): Don't initialize tty_display_method_template. (ring_bell, set_terminal_modes, reset_terminal_modes, update_begin) (update_end, set_terminal_window, cursor_to, raw_cursor_to, clear_to_end) (clear_frame, clear_end_of_line, write_glyphs, insert_glyphs) (delete_glyphs, ins_del_lines): Access display hooks through the frame pointer. (Ftty_display_color_p): Use the frame given as a parameter, or else return nil. (Ftty_display_color_cells): Ditto. (get_named_tty): Renamed to get_named_tty_display, changed return type to struct display. (term_dummy_init): Renamed to initial_term_init. Create and return an initial display. (term_init): Initialize a new struct display and return a pointer to it instead of tty_display_info. Removed frame initialization kludge. (Fdelete_tty): Updated for struct display. (delete_tty): The parameter type is now struct display, not tty_display_info. Delete the display, too. (create_tty_output): New function for creating tty_output structures. (delete_tty_output): New function for deleting tty_output structures. (create_display): New function for creating and registering display structures. (delete_display): New function for deleting and unregistering display structures. src/dispextern.h: Updated prototypes. src/dispnew.c: Include frame.h before termhooks.h. (init_display): Updated term_init call to new signature. src/emacs.c: Include frame.h (for termhooks.h). src/keymap.c: Ditto. src/lread.c: Ditto. src/xsmfns.c: Ditto. src/process.c: Include frame.h before termhooks.h. src/frame.c (Fwindow_system): New function. (syms_of_frame): Initialize it. (make_terminal_frame): Open the terminal device before creating the new frame. Disable scrollbars here, term_init cannot do that anymore. (Fdelete_frame): Use the new delete_frame_hook, don't do display-specific frame deletion here. Ditto for delete_display_hook. (Fmouse_position, Fmouse_pixel_position, Fraise_frame, Flower_frame) (Fredirect_frame_focus): Access display hooks through the frame pointer. src/keyboard.c: Include frame.h before termhooks.h. (start_polling, input_polling_used, stop_polling, gobble_input): Ignore read_socket_hook. (kbd_buffer_get_event, Fset_input_mode): Access display hooks through the frame pointer. (read_avail_input): Loop through all display devices for and call all read_socket_hook functions. Check ttys even if read_socket_hook returned an error. src/sysdep.c (discard_tty_input): Ignore read_socket_hook. (stuff_char): Don't do anything if the current frame is not on a termcap display. (request_sigio, unrequest_sigio): Ignore read_socket_hook. (init_sys_modes): Always call narrow_foreground_group. Set up terminal modes and sigio even under X. src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal) (set_vertical_scroll_bar, redisplay_window): Access display hooks through the frame pointer. (echo_area_display): Don't be afraid of termcap frames during an X+tty combo session. src/xfaces.c: Include termhooks.h. (Ftty_supports_face_attributes_p): Use the given frame, not selected_frame. src/xfns.c (x_set_scroll_bar_foreground, x_set_scroll_bar_background): Access display hooks through the frame pointer. (Fx_create_frame, x_create_tip_frame): Initialize the frame's display structure. src/xmenu.c: Include termhooks.h after frame.h. src/xselect.c (x_own_selection, some_frame_on_display, x_get_foreign_selection) (Fx_disown_selection_internal, Fx_get_cut_buffer_internal) (Fx_store_cut_buffer_internal, Fx_rotate_cut_buffers_internal): Don't do anything if the selected frame is not an X frame. src/xterm.c (x_display_method): Removed. (x_create_frame_display, x_delete_frame_display): New functions for handling struct display objects. (x_term_init): Set up a new struct display object, too. (x_delete_display): Delete the struct display corresponding to the X display. (x_initialize): Moved hook initialization to x_create_frame_display. src/xterm.h (x_display_method): Removed. (struct x_display_info): Added frame_display component. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-44
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 05 Jan 2004 05:54:35 +0000
parents 695cf19ef79e
children 18a818a2ee7c 375f2633d815
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 29581
diff changeset
1 ;;; gulp.el --- ask for updates for Lisp packages
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1996 Free Software Foundation, Inc.
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: Sam Shteingold <shteingd@math.ucla.edu>
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Maintainer: FSF
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Keywords: maintenance
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; any later version.
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
15742
80562f089595 Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 15211
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
80562f089595 Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 15211
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
80562f089595 Fix FSF address in comment.
Karl Heuer <kwzh@gnu.org>
parents: 15211
diff changeset
24 ;; Boston, MA 02111-1307, USA.
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;;; Commentary:
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; Search the emacs/{version}/lisp directory for *.el files, extract the
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; name of the author or maintainer and send him e-mail requesting
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; update.
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;;; Code:
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
33 (defgroup gulp nil
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
34 "Ask for updates for Lisp packages."
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
35 :prefix "-"
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
36 :group 'maint)
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
38 (defcustom gulp-discard "^;+ *Maintainer: *FSF *$"
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
39 "*The regexp matching the packages not requiring the request for updates."
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
40 :type 'regexp
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
41 :group 'gulp)
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
43 (defcustom gulp-tmp-buffer "*gulp*" "The name of the temporary buffer."
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
44 :type 'string
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
45 :group 'gulp)
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
47 (defcustom gulp-max-len 2000
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
48 "*Distance into a Lisp source file to scan for keywords."
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
49 :type 'integer
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
50 :group 'gulp)
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
52 (defcustom gulp-request-header
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
53 (concat
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
54 "This message was created automatically.
18012
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
55 I'm going to start pretesting a new version of GNU Emacs soon, so I'd
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
56 like to ask if you have any updates for the Emacs packages you work on.
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
57 You're listed as the maintainer of the following package(s):\n\n")
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
58 "*The starting text of a gulp message."
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
59 :type 'string
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
60 :group 'gulp)
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
62 (defcustom gulp-request-end
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
63 (concat
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
64 "\nIf you have any changes since the version in the previous release ("
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
65 (format "%d.%d" emacs-major-version emacs-minor-version)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
66 "),
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
67 please send them to me ASAP.
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68
18012
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
69 Please don't send the whole file. Instead, please send a patch made with
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
70 `diff -c' that shows precisely the changes you would like me to install.
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
71 Also please include itemized change log entries for your changes;
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
72 please use lisp/ChangeLog as a guide for the style and for what kinds
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
73 of information to include.
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
74
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
75 Thanks.")
21365
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
76 "*The closing text in a gulp message."
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
77 :type 'string
db005054f15d Customized.
Stephen Eglen <stephen@gnu.org>
parents: 21044
diff changeset
78 :group 'gulp)
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
79
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
80 (defun gulp-send-requests (dir &optional time)
15179
be7cc250142a (gulp-search-path, gulp-packages): Variable deleted.
Richard M. Stallman <rms@gnu.org>
parents: 15178
diff changeset
81 "Send requests for updates to the authors of Lisp packages in directory DIR.
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
82 For each maintainer, the message consists of `gulp-request-header',
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
83 followed by the list of packages (with modification times if the optional
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
84 prefix argument TIME is non-nil), concluded with `gulp-request-end'.
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
85
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
86 You can't edit the messages, but you can confirm whether to send each one.
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
88 The list of addresses for which you decided not to send mail
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
89 is left in the `*gulp*' buffer at the end."
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
90 (interactive "DRequest updates for Lisp directory: \nP")
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
91 (save-excursion
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
92 (set-buffer (get-buffer-create gulp-tmp-buffer))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
93 (let ((m-p-alist (gulp-create-m-p-alist
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
94 (directory-files dir nil "^[^=].*\\.el$" t)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
95 dir))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
96 ;; Temporarily inhibit undo in the *gulp* buffer.
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
97 (buffer-undo-list t)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
98 mail-setup-hook msg node)
18012
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
99 (setq m-p-alist
21044
acdb727611dd (gulp-send-requests): Call sort properly.
Richard M. Stallman <rms@gnu.org>
parents: 18012
diff changeset
100 (sort m-p-alist
acdb727611dd (gulp-send-requests): Call sort properly.
Richard M. Stallman <rms@gnu.org>
parents: 18012
diff changeset
101 (function (lambda (a b)
acdb727611dd (gulp-send-requests): Call sort properly.
Richard M. Stallman <rms@gnu.org>
parents: 18012
diff changeset
102 (string< (car a) (car b))))))
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
103 (while (setq node (car m-p-alist))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
104 (setq msg (gulp-create-message (cdr node) time))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
105 (setq mail-setup-hook
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 48341
diff changeset
106 (lambda ()
29581
4d69640ddf11 (gulp-send-requests): Don't quote lambda.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28650
diff changeset
107 (mail-subject)
4d69640ddf11 (gulp-send-requests): Don't quote lambda.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28650
diff changeset
108 (insert "It's time for Emacs updates again")
4d69640ddf11 (gulp-send-requests): Don't quote lambda.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28650
diff changeset
109 (goto-char (point-max))
4d69640ddf11 (gulp-send-requests): Don't quote lambda.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28650
diff changeset
110 (insert msg)))
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
111 (mail nil (car node))
21044
acdb727611dd (gulp-send-requests): Call sort properly.
Richard M. Stallman <rms@gnu.org>
parents: 18012
diff changeset
112 (goto-char (point-min))
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
113 (if (y-or-n-p "Send? ") (mail-send)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
114 (kill-this-buffer)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
115 (set-buffer gulp-tmp-buffer)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
116 (insert (format "%s\n\n" node)))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
117 (setq m-p-alist (cdr m-p-alist))))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
118 (set-buffer gulp-tmp-buffer)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
119 (setq buffer-undo-list nil)))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
120
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
121
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
122 (defun gulp-create-message (rec time)
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 "Return the message string for REC, which is a list like (FILE TIME)."
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 (let (node (str gulp-request-header))
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 (while (setq node (car rec))
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
126 (setq str (concat str "\t" (car node)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
127 (if time (concat "\tLast modified:\t" (cdr node)))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
128 "\n"))
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 (setq rec (cdr rec)))
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 (concat str gulp-request-end)))
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
133 (defun gulp-create-m-p-alist (flist dir)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
134 "Create the maintainer/package alist for files in FLIST in DIR.
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
135 That is a list of elements, each of the form (MAINTAINER PACKAGES...)."
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 (save-excursion
18012
d0f4e2e9e1f8 (gulp-send-requests): Sort maintainers alphabetically.
Richard M. Stallman <rms@gnu.org>
parents: 15742
diff changeset
137 (let (mplist filen node mnt-tm mnt tm fl-tm)
15211
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
138 (get-buffer-create gulp-tmp-buffer)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
139 (set-buffer gulp-tmp-buffer)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
140 (setq buffer-undo-list t)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
141 (while flist
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
142 (setq fl-tm (gulp-maintainer (setq filen (car flist)) dir))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
143 (if (setq tm (cdr fl-tm) mnt (car fl-tm));; there is a definite maintainer
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
144 (if (setq node (assoc mnt mplist));; this is not a new maintainer
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
145 (setq mplist (cons (cons mnt (cons (cons filen tm) (cdr node)))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
146 (delete node mplist)))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
147 (setq mplist (cons (list mnt (cons filen (cdr fl-tm))) mplist))))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
148 (setq flist (cdr flist)))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
149 (erase-buffer)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
150 mplist)))
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
151
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
152 (defun gulp-maintainer (filenm dir)
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
153 "Return a list (MAINTAINER TIMESTAMP) for the package FILENM in directory DIR."
6bcff02ade49 Lots of fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15179
diff changeset
154 (save-excursion
28650
31505c4d5daf (gulp-maintainer): Use expand-file-name
Gerd Moellmann <gerd@gnu.org>
parents: 21365
diff changeset
155 (let* ((fl (expand-file-name filenm dir)) mnt
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 (timest (format-time-string "%Y-%m-%d %a %T %Z"
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (elt (file-attributes fl) 5))))
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 (set-buffer gulp-tmp-buffer)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 (erase-buffer)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 (insert-file-contents fl nil 0 gulp-max-len)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 (goto-char 1)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (if (re-search-forward gulp-discard nil t)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 (setq mnt nil) ;; do nothing, return nil
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 (goto-char 1)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (if (and (re-search-forward "^;+ *Maintainer: \\(.*\\)$" nil t)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (> (length (setq mnt (match-string 1))) 0))
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 () ;; found!
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 (goto-char 1)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 (if (re-search-forward "^;+ *Author: \\(.*\\)$" nil t)
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 (setq mnt (match-string 1))))
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 (if (= (length mnt) 0) (setq mnt nil))) ;; "^;; Author: $" --> nil
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 (cons mnt timest))))
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173
48341
595c4a350a47 Add provide call.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 38412
diff changeset
174 (provide 'gulp)
595c4a350a47 Add provide call.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 38412
diff changeset
175
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49598
diff changeset
176 ;;; arch-tag: 42750a11-460a-4efc-829f-342d075530e5
15178
c23003387bc9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 ;;; gulp.el ends here