Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 99893. ------------------------------------------------------------ revno: 99893 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 23:29:38 -0400 message: Move complete.el to lisp/obsolete. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-04-13 01:03:04 +0000 +++ etc/NEWS 2010-04-13 03:29:38 +0000 @@ -81,6 +81,8 @@ * Changes in Specialized Modes and Packages in Emacs 24.1 +** partial-completion-mode is now obsolete. + ** mpc.el: Can use pseudo tags of the form tag1|tag2 as a union of two tags. ** Customize === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-13 01:24:10 +0000 +++ lisp/ChangeLog 2010-04-13 03:29:38 +0000 @@ -1,5 +1,7 @@ 2010-04-13 Stefan Monnier + * obsolete/complete.el: Move from lisp/complete.el. + * pcomplete.el (pcomplete-here*): Fix mistaken change (bug#5935). * emacs-lisp/easy-mmode.el (define-minor-mode): Passing a nil argument === renamed file 'lisp/complete.el' => 'lisp/obsolete/complete.el' --- lisp/complete.el 2010-03-14 21:15:02 +0000 +++ lisp/obsolete/complete.el 2010-04-13 03:29:38 +0000 @@ -5,6 +5,7 @@ ;; Author: Dave Gillespie ;; Keywords: abbrev convenience +;; Obsolete-since: 24.1 ;; ;; Special thanks to Hallvard Furuseth for his many ideas and contributions. ------------------------------------------------------------ revno: 99892 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 23:06:50 -0400 message: Remove the Arch metafiles. diff: === removed file '.arch-inventory' --- .arch-inventory 2005-03-04 04:54:40 +0000 +++ .arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,7 +0,0 @@ -# Generated files -precious ^(config\.status|config\.cache)$ - -# Install-in-place makes these directories, so just ignore them -backup ^(bin|data|lock|site-lisp)$ - -# arch-tag: 6eeeaa4e-cc7e-4b22-b3d7-1089e155da14 === removed file 'admin/charsets/.arch-inventory' --- admin/charsets/.arch-inventory 2008-02-01 16:01:31 +0000 +++ admin/charsets/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Unlike most emacs dirs, admin/charsets has a simple non-autoconf-generated makefile -source ^(Makefile)$ - -# arch-tag: ee36cfe3-96f8-4e91-aec4-008c80a85e6b === removed file 'admin/unidata/.arch-inventory' --- admin/unidata/.arch-inventory 2008-02-05 09:06:00 +0000 +++ admin/unidata/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Generated at compile time -precious ^unidata\.txt$ - -# arch-tag: 7640ff84-9e72-45e6-a7c7-b7b307b73959 === removed file 'doc/lispref/.arch-inventory' --- doc/lispref/.arch-inventory 2007-09-06 04:17:19 +0000 +++ doc/lispref/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Generated files -precious ^(config\.status|config\.cache)$ - -# arch-tag: dde817a2-94ff-4c6e-838c-bb5b33e7f0df === removed file 'etc/.arch-inventory' --- etc/.arch-inventory 2008-02-01 16:01:31 +0000 +++ etc/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ -# Unlike most emacs dirs, etc has a simple non-autoconf-generated makefile -source ^(Makefile)$ - -# Auto-generated files, which ignore -precious ^(buildobj\.lst)$ - -# Generated files (DOC-X is generated on windows) -backup ^(DOC(|-[0-9.]*|-X))$ - -# Install-in-place on NT makes this directory, so just ignore it -backup ^(icons)$ - -# arch-tag: 5a1d62e0-593a-48cd-8743-8d45dc58dfae === removed file 'info/.arch-inventory' --- info/.arch-inventory 2005-03-23 02:48:32 +0000 +++ info/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,20 +0,0 @@ -# There are only three real source files in this directory: -# -# "dir", ".cvsignore", and this file, ".arch-inventory" - -# Everything else is generated at compile time. Unfortunately, the "backup" -# category overrides the "source" category, so we have to have horrible -# regexp that matches everything _except_ "dir"... - -# 1 or 2 characters long -backup ^[a-zA-Z0-9][-_.a-zA-Z0-9]?$ -# 4 or more characters long -backup ^[a-zA-Z0-9][-_.a-zA-Z0-9][-_.a-zA-Z0-9][-_.a-zA-Z0-9]+$ -# 3 chars long, but 1st char not "d" -backup ^[abce-zA-Z0-9][-_.a-zA-Z0-9][-_.a-zA-Z0-9]$ -# 3 chars long, but 2nd char not "i" -backup ^[a-zA-Z0-9][-_.a-hj-zA-Z0-9][-_.a-zA-Z0-9]$ -# 3 chars long, but 3rd char not "r" -backup ^[a-zA-Z0-9][-_.a-zA-Z0-9][-_.a-qs-zA-Z0-9]$ - -# arch-tag: 60144ab9-cdc1-45b6-8193-b9683c80ec86 === removed file 'leim/.arch-inventory' --- leim/.arch-inventory 2004-06-12 04:51:11 +0000 +++ leim/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Auto-generated files, which ignore. -precious ^(stamp-subdir|changed\..*|leim-list\.el)$ - -# arch-tag: a4cda8ae-2a52-4d85-bd29-14e25c7ed2a2 === removed file 'leim/quail/.arch-inventory' --- leim/quail/.arch-inventory 2004-06-12 13:13:44 +0000 +++ leim/quail/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Auto-generated lisp files, which ignore. -precious ^([A-Z0-9].*|tsang-.*|quick-.*)\.el$ - -# arch-tag: 3d0d3e6b-f7c3-4dce-9135-a72ba7fe095d === removed file 'lib-src/.arch-inventory' --- lib-src/.arch-inventory 2009-08-19 02:54:46 +0000 +++ lib-src/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,10 +0,0 @@ -# Ignore binaries -backup ^(test-distrib|make-docfile|profile|digest-doc|movemail|fakemail|blessmail|hexl|update-game-score|etags|ctags|emacsclient|b2m|ebrowse|sorted-doc)$ - -# Building actually makes a copy/link of the source file -precious ^(ctags\.c)$ - -# Windows generates this -backup ^(DOC)$ - -# arch-tag: da33b3d6-170d-4fe5-9eb8-ed2753bc9b4f === removed file 'lisp/.arch-inventory' --- lisp/.arch-inventory 2006-02-03 19:31:55 +0000 +++ lisp/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Auto-generated lisp files, which ignore -precious ^(loaddefs|finder-inf|cus-load)\.el$ - -# arch-tag: fc62dc9f-3a91-455b-b8e7-d49df66beee0 === removed file 'lisp/calc/.arch-inventory' --- lisp/calc/.arch-inventory 2008-04-23 08:54:31 +0000 +++ lisp/calc/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Auto-generated lisp files, which ignore -precious ^(.*-loaddefs)\.el$ - -# arch-tag: 5258f69e-459b-449b-bdd7-bdbd5f948cb9 === removed file 'lisp/calendar/.arch-inventory' --- lisp/calendar/.arch-inventory 2008-04-23 08:54:31 +0000 +++ lisp/calendar/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Auto-generated lisp files, which ignore -precious ^(.*-loaddefs)\.el$ - -# arch-tag: 6246cac0-cd69-4d59-8677-c1451a4d5831 === removed file 'lisp/eshell/.arch-inventory' --- lisp/eshell/.arch-inventory 2004-06-12 04:51:11 +0000 +++ lisp/eshell/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Generated files -precious ^(esh-groups)\.el$ - -# arch-tag: 8dc7bfaa-6ca6-4be0-915a-1e539c3dabfb === removed file 'lisp/mh-e/.arch-inventory' --- lisp/mh-e/.arch-inventory 2005-10-24 06:00:50 +0000 +++ lisp/mh-e/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -# Auto-generated lisp files, which ignore -precious ^(mh-loaddefs)\.el$ - -# arch-tag: 03c1cf02-6c80-44af-b4ec-b41b53fbf8f2 === removed file 'nt/.arch-inventory' --- nt/.arch-inventory 2005-03-23 01:54:50 +0000 +++ nt/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,3 +0,0 @@ -source ^subdirs\.el$ - -# arch-tag: 01b87183-9d94-4b6b-93cb-fece25c4eec9 === removed file 'src/.arch-inventory' --- src/.arch-inventory 2007-05-13 13:26:57 +0000 +++ src/.arch-inventory 1970-01-01 00:00:00 +0000 @@ -1,12 +0,0 @@ -# Source files which don't match the usual naming conventions, mostly dot files -source ^\.(gdbinit|dbxinit)$ - -# Auto-generated files, which ignore -precious ^(config\.stamp|config\.h|epaths\.h|buildobj\.lst)$ -precious ^(TAGS-LISP)$ -precious ^(buildobj\.lst)$ - -backup ^(stamp-oldxmenu|prefix-args|temacs|emacs|emacs-[0-9.]*)$ -backup ^(bootstrap-emacs)$ - -# arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543 ------------------------------------------------------------ revno: 99891 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 22:19:17 -0400 message: (init_tty): Move common text outside of #ifdef TERMINFO. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-13 02:07:48 +0000 +++ src/ChangeLog 2010-04-13 02:19:17 +0000 @@ -1,5 +1,7 @@ 2010-04-13 Stefan Monnier + * term.c (init_tty): Move common text outside of #ifdef TERMINFO. + Try to solve the problem of spurious EOF chars in long lines of text sent to interactive subprocesses. * sysdep.c (child_setup_tty): Do not enable ICANON any more. === modified file 'src/term.c' --- src/term.c 2010-03-13 09:02:01 +0000 +++ src/term.c 2010-04-13 02:19:17 +0000 @@ -3593,25 +3593,18 @@ } if (status == 0) { + maybe_fatal (must_succeed, terminal, + "Terminal type %s is not defined", + "Terminal type %s is not defined.\n\ +If that is not the actual type of terminal you have,\n\ +use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ +`setenv TERM ...') to specify the correct type. It may be necessary\n" #ifdef TERMINFO - maybe_fatal (must_succeed, terminal, - "Terminal type %s is not defined", - "Terminal type %s is not defined.\n\ -If that is not the actual type of terminal you have,\n\ -use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ -`setenv TERM ...') to specify the correct type. It may be necessary\n\ -to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", - terminal_type); +"to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", #else - maybe_fatal (must_succeed, terminal, - "Terminal type %s is not defined", - "Terminal type %s is not defined.\n\ -If that is not the actual type of terminal you have,\n\ -use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ -`setenv TERM ...') to specify the correct type. It may be necessary\n\ -to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", - terminal_type); +"to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", #endif + terminal_type); } #ifndef TERMINFO @@ -3878,20 +3871,15 @@ { maybe_fatal (must_succeed, terminal, "Terminal type \"%s\" is not powerful enough to run Emacs", + "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ +It lacks the ability to position the cursor.\n\ +If that is not the actual type of terminal you have,\n\ +use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ +`setenv TERM ...') to specify the correct type. It may be necessary\n" # ifdef TERMINFO - "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ -It lacks the ability to position the cursor.\n\ -If that is not the actual type of terminal you have,\n\ -use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ -`setenv TERM ...') to specify the correct type. It may be necessary\n\ -to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", +"to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.", # else /* TERMCAP */ - "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ -It lacks the ability to position the cursor.\n\ -If that is not the actual type of terminal you have,\n\ -use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ -`setenv TERM ...') to specify the correct type. It may be necessary\n\ -to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", +"to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", # endif /* TERMINFO */ terminal_type); } ------------------------------------------------------------ revno: 99890 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 22:07:48 -0400 message: Try to solve the problem of spurious EOF chars in long lines of text sent to interactive subprocesses. * sysdep.c (child_setup_tty): Do not enable ICANON any more. (system_process_attributes): Remove unused var `ttotal'. * process.c (send_process): Don't bother breaking long line with EOF chars when talking to ttys any more. (wait_reading_process_output): Output a warning when called in such a way that it could block without being interruptible. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-13 01:47:40 +0000 +++ src/ChangeLog 2010-04-13 02:07:48 +0000 @@ -1,5 +1,14 @@ 2010-04-13 Stefan Monnier + Try to solve the problem of spurious EOF chars in long lines of text + sent to interactive subprocesses. + * sysdep.c (child_setup_tty): Do not enable ICANON any more. + (system_process_attributes): Remove unused var `ttotal'. + * process.c (send_process): Don't bother breaking long line with EOF + chars when talking to ttys any more. + (wait_reading_process_output): Output a warning when called in such + a way that it could block without being interruptible. + Try to detect file modification within the same second. * buffer.h (struct buffer): New field modtime_size. * buffer.c (reset_buffer): Initialize it. === modified file 'src/process.c' --- src/process.c 2010-04-12 23:49:29 +0000 +++ src/process.c 2010-04-13 02:07:48 +0000 @@ -4643,6 +4643,10 @@ FD_ZERO (&Connecting); #endif + if (time_limit == 0 && wait_proc && !NILP (Vinhibit_quit) + && !(CONSP (wait_proc->status) && EQ (XCAR (wait_proc->status), Qexit))) + message ("Blocking call to accept-process-output with quit inhibited!!"); + /* If wait_proc is a process to watch, set wait_channel accordingly. */ if (wait_proc != NULL) wait_channel = wait_proc->infd; @@ -5768,34 +5772,6 @@ { int this = len; - /* Decide how much data we can send in one batch. - Long lines need to be split into multiple batches. */ - if (p->pty_flag) - { - /* Starting this at zero is always correct when not the first - iteration because the previous iteration ended by sending C-d. - It may not be correct for the first iteration - if a partial line was sent in a separate send_process call. - If that proves worth handling, we need to save linepos - in the process object. */ - int linepos = 0; - unsigned char *ptr = (unsigned char *) buf; - unsigned char *end = (unsigned char *) buf + len; - - /* Scan through this text for a line that is too long. */ - while (ptr != end && linepos < pty_max_bytes) - { - if (*ptr == '\n') - linepos = 0; - else - linepos++; - ptr++; - } - /* If we found one, break the line there - and put in a C-d to force the buffer through. */ - this = ptr - buf; - } - /* Send this batch, using one or more write calls. */ while (this > 0) { @@ -5899,11 +5875,6 @@ len -= rv; this -= rv; } - - /* If we sent just part of the string, put in an EOF (C-d) - to force it through, before we send the rest. */ - if (len > 0) - Fprocess_send_eof (proc); } } else === modified file 'src/sysdep.c' --- src/sysdep.c 2010-04-02 03:10:33 +0000 +++ src/sysdep.c 2010-04-13 02:07:48 +0000 @@ -529,8 +529,6 @@ #endif s.main.c_oflag &= ~TAB3; /* Disable tab expansion */ s.main.c_cflag = (s.main.c_cflag & ~CSIZE) | CS8; /* Don't strip 8th bit */ - s.main.c_lflag |= ICANON; /* Enable erase/kill and eof processing */ - s.main.c_cc[VEOF] = 04; /* insure that EOF is Control-D */ s.main.c_cc[VERASE] = CDISABLE; /* disable erase processing */ s.main.c_cc[VKILL] = CDISABLE; /* disable kill processing */ @@ -560,7 +558,6 @@ /* rms: Formerly it set s.main.c_cc[VINTR] to 0377 here unconditionally. Then a SIGNALS_VIA_CHARACTERS conditional would force it to 0377. That looks like duplicated code. */ - s.main.c_cc[VEOL] = CDISABLE; s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ #endif /* AIX */ @@ -573,6 +570,18 @@ s.main.sg_kill = 0377; s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */ + /* We used to enable ICANON (and set VEOF to 04), but this leads to + problems where process.c wants to send EOFs every once in a while + to force the output, which leads to weird effects when the + subprocess has disabled ICANON and ends up seeing those spurious + extra EOFs. So we don't send EOFs any more in + process.c:send_process, and instead we disable ICANON by default, + so if a subsprocess sets up ICANON, it's his problem (or the Elisp + package that talks to it) to deal with lines that are too long. */ + s.main.c_lflag &= ~ICANON; /* Disable line editing and eof processing */ + s.main.c_cc[VMIN] = 1; + s.main.c_cc[VTIME] = 0; + #endif /* not HAVE_TERMIO */ EMACS_SET_TTY (out, &s, 0); @@ -3344,7 +3353,7 @@ unsigned long minflt, majflt, cminflt, cmajflt, vsize; time_t sec; unsigned usec; - EMACS_TIME tnow, tstart, tboot, telapsed,ttotal; + EMACS_TIME tnow, tstart, tboot, telapsed; double pcpu, pmem; Lisp_Object attrs = Qnil; Lisp_Object cmd_str, decoded_cmd, tem; ------------------------------------------------------------ revno: 99889 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 21:47:40 -0400 message: Try to detect file modification within the same second. * buffer.h (struct buffer): New field modtime_size. * buffer.c (reset_buffer): Initialize it. * fileio.c (Finsert_file_contents, Fwrite_region): Set it. (Fverify_visited_file_modtime): Check it. (Fclear_visited_file_modtime, Fset_visited_file_modtime): Clear it. (Fset_visited_file_modtime): Set (or clear) it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-12 23:49:29 +0000 +++ src/ChangeLog 2010-04-13 01:47:40 +0000 @@ -1,3 +1,13 @@ +2010-04-13 Stefan Monnier + + Try to detect file modification within the same second. + * buffer.h (struct buffer): New field modtime_size. + * buffer.c (reset_buffer): Initialize it. + * fileio.c (Finsert_file_contents, Fwrite_region): Set it. + (Fverify_visited_file_modtime): Check it. + (Fclear_visited_file_modtime, Fset_visited_file_modtime): Clear it. + (Fset_visited_file_modtime): Set (or clear) it. + 2010-04-12 Stefan Monnier * process.c (status_notify): Remove unused var `ro'. === modified file 'src/buffer.c' --- src/buffer.c 2010-04-02 03:10:33 +0000 +++ src/buffer.c 2010-04-13 01:47:40 +0000 @@ -693,6 +693,7 @@ b->file_truename = Qnil; b->directory = (current_buffer) ? current_buffer->directory : Qnil; b->modtime = 0; + b->modtime_size = -1; XSETFASTINT (b->save_length, 0); b->last_window_start = 1; /* It is more conservative to start out "changed" than "unchanged". */ === modified file 'src/buffer.h' --- src/buffer.h 2010-01-16 11:57:09 +0000 +++ src/buffer.h 2010-04-13 01:47:40 +0000 @@ -513,6 +513,12 @@ 0 means visited file modtime unknown; in no case complain about any mismatch on next save attempt. */ int modtime; + /* Size of the file when modtime was set. This is used to detect the + case where the file grew while we were reading it, so the modtime + is still the same (since it's rounded up to seconds) but we're actually + not up-to-date. -1 means the size is unknown. Only meaningful if + modtime is actually set. */ + EMACS_INT modtime_size; /* The value of text->modiff at the last auto-save. */ int auto_save_modified; /* The value of text->modiff at the last display error. === modified file 'src/fileio.c' --- src/fileio.c 2010-04-02 03:10:33 +0000 +++ src/fileio.c 2010-04-13 01:47:40 +0000 @@ -4092,6 +4092,7 @@ if (NILP (handler)) { current_buffer->modtime = st.st_mtime; + current_buffer->modtime_size = st.st_size; current_buffer->filename = orig_filename; } @@ -4695,7 +4696,10 @@ to avoid a "file has changed on disk" warning on next attempt to save. */ if (visiting) - current_buffer->modtime = st.st_mtime; + { + current_buffer->modtime = st.st_mtime; + current_buffer->modtime_size = st.st_size; + } if (failure) error ("IO error writing %s: %s", SDATA (filename), @@ -5004,11 +5008,13 @@ else st.st_mtime = 0; } - if (st.st_mtime == b->modtime - /* If both are positive, accept them if they are off by one second. */ - || (st.st_mtime > 0 && b->modtime > 0 - && (st.st_mtime == b->modtime + 1 - || st.st_mtime == b->modtime - 1))) + if ((st.st_mtime == b->modtime + /* If both are positive, accept them if they are off by one second. */ + || (st.st_mtime > 0 && b->modtime > 0 + && (st.st_mtime == b->modtime + 1 + || st.st_mtime == b->modtime - 1))) + && (st.st_size == b->modtime_size + || b->modtime_size < 0)) return Qt; return Qnil; } @@ -5020,6 +5026,7 @@ () { current_buffer->modtime = 0; + current_buffer->modtime_size = -1; return Qnil; } @@ -5049,7 +5056,10 @@ Lisp_Object time_list; { if (!NILP (time_list)) - current_buffer->modtime = cons_to_long (time_list); + { + current_buffer->modtime = cons_to_long (time_list); + current_buffer->modtime_size = -1; + } else { register Lisp_Object filename; @@ -5068,7 +5078,10 @@ filename = ENCODE_FILE (filename); if (stat (SDATA (filename), &st) >= 0) - current_buffer->modtime = st.st_mtime; + { + current_buffer->modtime = st.st_mtime; + current_buffer->modtime_size = st.st_size; + } } return Qnil; ------------------------------------------------------------ revno: 99888 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 21:24:10 -0400 message: * pcomplete.el (pcomplete-here*): Fix mistaken change (bug#5935). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-13 01:03:04 +0000 +++ lisp/ChangeLog 2010-04-13 01:24:10 +0000 @@ -1,5 +1,7 @@ 2010-04-13 Stefan Monnier + * pcomplete.el (pcomplete-here*): Fix mistaken change (bug#5935). + * emacs-lisp/easy-mmode.el (define-minor-mode): Passing a nil argument to the minor mode function now turns the mode ON unconditionally. === modified file 'lisp/pcomplete.el' --- lisp/pcomplete.el 2010-01-13 08:35:10 +0000 +++ lisp/pcomplete.el 2010-04-13 01:24:10 +0000 @@ -1113,7 +1113,7 @@ (defmacro pcomplete-here* (&optional form stub form-only) "An alternate form which does not participate in argument paring." (declare (debug t)) - `(pcomplete-here (lambda () ,form) ,stub t ,form-only)) + `(pcomplete-here ,form ,stub t ,form-only)) ;; display support ------------------------------------------------------------ revno: 99887 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 21:03:04 -0400 message: (define-minor-mode): A nil argument to the minor mode turns the mode ON. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-04-11 18:25:09 +0000 +++ etc/NEWS 2010-04-13 01:03:04 +0000 @@ -140,6 +140,8 @@ * Incompatible Lisp Changes in Emacs 24.1 +** Passing a nil argument to a minor mode function now turns the mode + ON unconditionally. * Lisp changes in Emacs 24.1 === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-12 19:14:16 +0000 +++ lisp/ChangeLog 2010-04-13 01:03:04 +0000 @@ -1,3 +1,8 @@ +2010-04-13 Stefan Monnier + + * emacs-lisp/easy-mmode.el (define-minor-mode): Passing a nil argument + to the minor mode function now turns the mode ON unconditionally. + 2010-04-12 Stefan Monnier * vc-dir.el (vc-dir-kill-line): New command. === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2010-01-13 08:35:10 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2010-04-13 01:03:04 +0000 @@ -222,15 +222,10 @@ (interactive (list (or current-prefix-arg 'toggle))) (let ((,last-message (current-message))) (setq ,mode - (cond - ((eq arg 'toggle) (not ,mode)) - (arg (> (prefix-numeric-value arg) 0)) - (t - (if (null ,mode) t - (message - "Toggling %s off; better pass an explicit argument." - ',mode) - nil)))) + (if (eq arg 'toggle) + (not ,mode) + ;; A nil argument also means ON now. + (> (prefix-numeric-value arg) 0))) ,@body ;; The on/off hooks are here for backward compatibility only. (run-hooks ',hook (if ,mode ',hook-on ',hook-off)) ------------------------------------------------------------ revno: 99886 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 19:49:29 -0400 message: * process.c (status_notify): Remove unused var `ro'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-12 18:58:15 +0000 +++ src/ChangeLog 2010-04-12 23:49:29 +0000 @@ -1,3 +1,7 @@ +2010-04-12 Stefan Monnier + + * process.c (status_notify): Remove unused var `ro'. + 2010-04-12 Jan Djärv * xfns.c (select_visual): Don't call error if XGetVisualInfo returns === modified file 'src/process.c' --- src/process.c 2010-04-11 16:15:09 +0000 +++ src/process.c 2010-04-12 23:49:29 +0000 @@ -6982,13 +6982,11 @@ when a process becomes runnable. */ else if (!EQ (symbol, Qrun) && !NILP (buffer)) { - Lisp_Object ro, tem; + Lisp_Object tem; struct buffer *old = current_buffer; int opoint, opoint_byte; int before, before_byte; - ro = XBUFFER (buffer)->read_only; - /* Avoid error if buffer is deleted (probably that's why the process is dead, too) */ if (NILP (XBUFFER (buffer)->name)) ------------------------------------------------------------ revno: 99885 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 15:14:16 -0400 message: (vc-dir-kill-line): New command. (vc-dir-mode-map): Bind it to C-k. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-12 19:12:36 +0000 +++ lisp/ChangeLog 2010-04-12 19:14:16 +0000 @@ -1,5 +1,8 @@ 2010-04-12 Stefan Monnier + * vc-dir.el (vc-dir-kill-line): New command. + (vc-dir-mode-map): Bind it to C-k. + * bookmark.el (bookmark-insert-location): Handle a nil filename. * woman.el: Add bookmark declarations to silence the compiler. === modified file 'lisp/vc-dir.el' --- lisp/vc-dir.el 2010-03-24 17:33:39 +0000 +++ lisp/vc-dir.el 2010-04-12 19:14:16 +0000 @@ -263,6 +263,7 @@ (define-key map [mouse-2] 'vc-dir-toggle-mark) (define-key map [follow-link] 'mouse-face) (define-key map "x" 'vc-dir-hide-up-to-date) + (define-key map [?\C-k] 'vc-dir-kill-line) (define-key map "S" 'vc-dir-search) ;; FIXME: Maybe use A like dired? (define-key map "Q" 'vc-dir-query-replace-regexp) (define-key map (kbd "M-s a C-s") 'vc-dir-isearch) @@ -1088,6 +1089,13 @@ (ewoc-delete vc-ewoc crt)) (setq crt prev))))) +(defun vc-dir-kill-line () + "Remove the current line from display." + (interactive) + (let ((crt (ewoc-locate vc-ewoc)) + (inhibit-read-only t)) + (ewoc-delete vc-ewoc crt))) + (defun vc-dir-printer (fileentry) (vc-call-backend vc-dir-backend 'dir-printer fileentry)) ------------------------------------------------------------ revno: 99884 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 15:12:36 -0400 message: * bookmark.el (bookmark-insert-location): Handle a nil filename. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-12 16:09:47 +0000 +++ lisp/ChangeLog 2010-04-12 19:12:36 +0000 @@ -1,5 +1,7 @@ 2010-04-12 Stefan Monnier + * bookmark.el (bookmark-insert-location): Handle a nil filename. + * woman.el: Add bookmark declarations to silence the compiler. (bookmark-prop-get): Use `man-args' rather than `filename' as a first step to compatibility between man and woman bookmarks. === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2010-04-12 16:09:47 +0000 +++ lisp/bookmark.el 2010-04-12 19:12:36 +0000 @@ -1176,7 +1176,9 @@ (or no-history (bookmark-maybe-historicize-string bookmark)) (let ((start (point))) (prog1 - (insert (bookmark-location bookmark)) ; *Return this line* + ;; FIXME: Each bookmark should come with a `location' method + ;; rather than just say "-- no file --". + (insert (or (bookmark-location bookmark) " -- no file --")) (if (display-mouse-p) (add-text-properties start ------------------------------------------------------------ revno: 99883 committer: Jan D. branch nick: trunk timestamp: Mon 2010-04-12 20:58:15 +0200 message: xfns.c (select_visual): Don't call error if XGetVisualInfo returns more than one visual (Bug#5938). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-12 14:32:10 +0000 +++ src/ChangeLog 2010-04-12 18:58:15 +0000 @@ -1,3 +1,8 @@ +2010-04-12 Jan Djärv + + * xfns.c (select_visual): Don't call error if XGetVisualInfo returns + more than one visual (Bug#5938). + 2010-04-12 Dan Nicolaescu * Makefile.in (C_SWITCH_SYSTEM,C_SWITCH_MACHINE,C_SWITCH_X_SITE): Undefine. === modified file 'src/xfns.c' --- src/xfns.c 2010-04-10 10:59:46 +0000 +++ src/xfns.c 2010-04-12 18:58:15 +0000 @@ -4129,7 +4129,7 @@ vinfo_template.screen = XScreenNumberOfScreen (screen); vinfo = XGetVisualInfo (dpy, VisualIDMask | VisualScreenMask, &vinfo_template, &n_visuals); - if (n_visuals != 1) + if (n_visuals <= 0) fatal ("Can't get proper X visual info"); dpyinfo->n_planes = vinfo->depth; ------------------------------------------------------------ revno: 99882 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 12:09:47 -0400 message: Clean up last bookmark changes for man/woman/gnus-summary. * gnus-sum.el: Add bookmark declarations to silence the compiler. (gnus-mark-xrefs-as-read, gnus-summary-limit-to-bodies): Use with-current-buffer to silence the byte-compiler. (gnus-summary-bookmark-make-record): Use derived-mode-p and don't bother to require `gnus'. (gnus-summary-bookmark-jump): Don't forget to autoload. Simplify. * woman.el: Add bookmark declarations to silence the compiler. (bookmark-prop-get): Use `man-args' rather than `filename' as a first step to compatibility between man and woman bookmarks. Adjust for Man-default-bookmark-title renaming. (woman-bookmark-jump): Adjust accordingly. Don't forget to autoload. * man.el: Add bookmark declarations to silence the compiler. (Man-name-local-regexp): Make it match NAME as well. (Man-getpage-in-background): Return the buffer. (Man-notify-when-ready): Use `case'. (man-set-default-bookmark-title): Rename to Man-default-bookmark-title. Don't hardcode "NAME". Simplify. (Man-bookmark-make-record): Use Man-arguments rather than buffer-name. Rename from Man-bookmark-make-record. (Man-bookmark-jump): Rename from man-bookmark-jump. Simplify now that we have the actual man-args. Use Man-getpage-in-background rather than `man' since the arg is already processed. Let bookmark.el do the window handling. Only wait for the relevant process. Don't forget to autoload. * bookmark.el (bookmark-default-file): Use locate-user-emacs-file. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-12 15:17:29 +0000 +++ lisp/ChangeLog 2010-04-12 16:09:47 +0000 @@ -1,3 +1,27 @@ +2010-04-12 Stefan Monnier + + * woman.el: Add bookmark declarations to silence the compiler. + (bookmark-prop-get): Use `man-args' rather than `filename' as a first + step to compatibility between man and woman bookmarks. + Adjust for Man-default-bookmark-title renaming. + (woman-bookmark-jump): Adjust accordingly. Don't forget to autoload. + + * man.el: Add bookmark declarations to silence the compiler. + (Man-name-local-regexp): Make it match NAME as well. + (Man-getpage-in-background): Return the buffer. + (Man-notify-when-ready): Use `case'. + (man-set-default-bookmark-title): Rename to Man-default-bookmark-title. + Don't hardcode "NAME". Simplify. + (Man-bookmark-make-record): Use Man-arguments rather than buffer-name. + Rename from Man-bookmark-make-record. + (Man-bookmark-jump): Rename from man-bookmark-jump. Simplify now that + we have the actual man-args. Use Man-getpage-in-background rather + than `man' since the arg is already processed. Let bookmark.el do the + window handling. Only wait for the relevant process. + Don't forget to autoload. + + * bookmark.el (bookmark-default-file): Use locate-user-emacs-file. + 2010-04-12 Thierry Volpiatto * woman.el (woman-bookmark-make-record, woman-bookmark-jump): === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2010-02-18 18:52:36 +0000 +++ lisp/bookmark.el 2010-04-12 16:09:47 +0000 @@ -92,7 +92,7 @@ (if bookmark-file ;; In case user set `bookmark-file' in her .emacs: bookmark-file - (convert-standard-filename "~/.emacs.bmk")) + (locate-user-emacs-file "bookmarks" ".emacs.bmk")) "File in which to save bookmarks by default." :type 'file :group 'bookmark) === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-04-12 15:17:29 +0000 +++ lisp/gnus/ChangeLog 2010-04-12 16:09:47 +0000 @@ -1,3 +1,12 @@ +2010-04-12 Stefan Monnier + + * gnus-sum.el: Add bookmark declarations to silence the compiler. + (gnus-mark-xrefs-as-read, gnus-summary-limit-to-bodies): + Use with-current-buffer to silence the byte-compiler. + (gnus-summary-bookmark-make-record): Use derived-mode-p and don't + bother to require `gnus'. + (gnus-summary-bookmark-jump): Don't forget to autoload. Simplify. + 2010-04-12 Thierry Volpiatto * gnus-sum.el (gnus-summary-bookmark-make-record) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-04-12 15:17:29 +0000 +++ lisp/gnus/gnus-sum.el 2010-04-12 16:09:47 +0000 @@ -3017,7 +3017,7 @@ (declare-function turn-on-gnus-mailing-list-mode "gnus-ml" ()) - +(defvar bookmark-make-record-function) (defun gnus-summary-mode (&optional group) @@ -3072,7 +3072,6 @@ (gnus-run-mode-hooks 'gnus-summary-mode-hook) (turn-on-gnus-mailing-list-mode) (mm-enable-multibyte) - ;; Bookmark support. (set (make-local-variable 'bookmark-make-record-function) 'gnus-summary-bookmark-make-record) (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) @@ -6093,8 +6092,7 @@ "Look through all the headers and mark the Xrefs as read." (let ((virtual (gnus-virtual-group-p from-newsgroup)) name info xref-hashtb idlist method nth4) - (save-excursion - (set-buffer gnus-group-buffer) + (with-current-buffer gnus-group-buffer (when (setq xref-hashtb (gnus-create-xref-hashtb from-newsgroup headers unreads)) (mapatoms @@ -8344,8 +8342,7 @@ (dolist (data gnus-newsgroup-data) (let (gnus-mark-article-hook) (gnus-summary-select-article t t nil (gnus-data-number data))) - (save-excursion - (set-buffer gnus-article-buffer) + (with-current-buffer gnus-article-buffer (article-goto-body) (let* ((case-fold-search t) (found (if headersp @@ -9029,7 +9026,7 @@ (setq group (format "%s-%d" gnus-newsgroup-name article)) (gnus-summary-remove-process-mark article) (when (gnus-summary-display-article article) - (save-excursion + (save-excursion ;;What for? (with-temp-buffer (insert-buffer-substring gnus-original-article-buffer) ;; Remove some headers that may lead nndoc to make @@ -12643,12 +12640,15 @@ (gnus-summary-limit (gnus-sorted-nunion old new)))) (gnus-summary-position-point))) -;;; BOOKMARK support for GNUS. +;;; Bookmark support for Gnus. +(declare-function bookmark-make-record-default "bookmark" (&optional pos-only)) +(declare-function bookmark-prop-get "bookmark" (bookmark prop)) +(declare-function bookmark-default-handler "bookmark" (bmk)) +(declare-function bookmark-get-bookmark-record "bookmark" (bmk)) (defun gnus-summary-bookmark-make-record () - "Make a bookmark entry for a Gnus buffer." - (require 'gnus) - (unless (and (eq major-mode 'gnus-summary-mode) gnus-article-current) + "Make a bookmark entry for a Gnus summary buffer." + (unless (and (derived-mode-p 'gnus-summary-mode) gnus-article-current) (error "Please retry from the Gnus summary buffer")) ;[1] (let* ((subject (elt (gnus-summary-article-header) 1)) (grp (car gnus-article-current)) @@ -12660,20 +12660,20 @@ (group . ,grp) (article . ,art) (message-id . ,id) (handler . gnus-summary-bookmark-jump)))) - +;;;###autoload (defun gnus-summary-bookmark-jump (bookmark) "Handler function for record returned by `gnus-summary-bookmark-make-record'. BOOKMARK is a bookmark name or a bookmark record." (let ((group (bookmark-prop-get bookmark 'group)) (article (bookmark-prop-get bookmark 'article)) - (id (bookmark-prop-get bookmark 'message-id)) - buf) + (id (bookmark-prop-get bookmark 'message-id))) (gnus-fetch-group group (list article)) (gnus-summary-insert-cached-articles) (gnus-summary-goto-article id nil 'force) - (setq buf (current-buffer)) (bookmark-default-handler - `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark))))) + `("" + (buffer . ,(current-buffer)) + . ,(bookmark-get-bookmark-record bookmark))))) (gnus-summary-make-all-marking-commands) === modified file 'lisp/man.el' --- lisp/man.el 2010-04-12 15:17:29 +0000 +++ lisp/man.el 2010-04-12 16:09:47 +0000 @@ -221,8 +221,8 @@ :type '(repeat string) :group 'man) -(defcustom Man-name-local-regexp "^NOM$" - "*The translation of the uppercase word NAME in your language. +(defcustom Man-name-local-regexp (concat "^" (regexp-opt '("NOM" "NAME")) "$") + "Regexp that matches the text that precedes the command's name. Used in `bookmark-set' to get the default bookmark name." :type 'string :group 'bookmark) @@ -888,7 +888,8 @@ (man man-args))) (defun Man-getpage-in-background (topic) - "Use TOPIC to build and fire off the manpage and cleaning command." + "Use TOPIC to build and fire off the manpage and cleaning command. +Return the buffer in which the manpage will appear." (let* ((man-args topic) (bufname (concat "*Man " man-args "*")) (buffer (get-buffer bufname))) @@ -966,15 +967,16 @@ (format "exited abnormally with code %d" exit-status))) (setq msg exit-status)) - (Man-bgproc-sentinel bufname msg))))))) + (Man-bgproc-sentinel bufname msg))))) + buffer)) (defun Man-notify-when-ready (man-buffer) "Notify the user when MAN-BUFFER is ready. See the variable `Man-notify-method' for the different notification behaviors." (let ((saved-frame (with-current-buffer man-buffer Man-original-frame))) - (cond - ((eq Man-notify-method 'newframe) + (case Man-notify-method + (newframe ;; Since we run asynchronously, perhaps while Emacs is waiting ;; for input, we must not leave a different buffer current. We ;; can't rely on the editor command loop to reselect the @@ -985,28 +987,27 @@ (set-window-dedicated-p (frame-selected-window frame) t) (or (display-multi-frame-p frame) (select-frame frame))))) - ((eq Man-notify-method 'pushy) + (pushy (switch-to-buffer man-buffer)) - ((eq Man-notify-method 'bully) + (bully (and (frame-live-p saved-frame) (select-frame saved-frame)) (pop-to-buffer man-buffer) (delete-other-windows)) - ((eq Man-notify-method 'aggressive) + (aggressive (and (frame-live-p saved-frame) (select-frame saved-frame)) (pop-to-buffer man-buffer)) - ((eq Man-notify-method 'friendly) + (friendly (and (frame-live-p saved-frame) (select-frame saved-frame)) (display-buffer man-buffer 'not-this-window)) - ((eq Man-notify-method 'polite) + (polite (beep) (message "Manual buffer %s is ready" (buffer-name man-buffer))) - ((eq Man-notify-method 'quiet) + (quiet (message "Manual buffer %s is ready" (buffer-name man-buffer))) - ((or (eq Man-notify-method 'meek) - t) + (t ;; meek (message "")) ))) @@ -1274,6 +1275,8 @@ ;; ====================================================================== ;; set up manual mode in buffer and build alists +(defvar bookmark-make-record-function) + (put 'Man-mode 'mode-class 'special) (defun Man-mode () @@ -1330,9 +1333,8 @@ (setq imenu-generic-expression (list (list nil Man-heading-regexp 0))) (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) - ;; Bookmark support. (set (make-local-variable 'bookmark-make-record-function) - 'man-bookmark-make-record) + 'Man-bookmark-make-record) (Man-build-page-list) (Man-strip-page-headers) (Man-unindent) @@ -1669,39 +1671,39 @@ complete-path)) ;;; Bookmark Man Support +(declare-function bookmark-make-record-default "bookmark" (&optional pos-only)) +(declare-function bookmark-prop-get "bookmark" (bookmark prop)) +(declare-function bookmark-default-handler "bookmark" (bmk)) +(declare-function bookmark-get-bookmark-record "bookmark" (bmk)) -(defun man-set-default-bookmark-title () - "Set default bookmark title for Man or woman page based \ -on NAME or `Man-name-local-regexp' entry." +(defun Man-default-bookmark-title () + "Default bookmark name for Man or WoMan pages. +Uses `Man-name-local-regexp'." (save-excursion (goto-char (point-min)) - (when (or (re-search-forward Man-name-local-regexp nil t) - (re-search-forward "^NAME$" nil t)) - (forward-line 1) - (unless (> (skip-chars-forward " ") 0) - (skip-chars-forward "\t")) + (when (re-search-forward Man-name-local-regexp nil t) + (skip-chars-forward "\n\t ") (buffer-substring-no-properties (point) (line-end-position))))) -(defun man-bookmark-make-record () +(defun Man-bookmark-make-record () "Make a bookmark entry for a Man buffer." - `(,(man-set-default-bookmark-title) + `(,(Man-default-bookmark-title) ,@(bookmark-make-record-default 'point-only) - (buffer-name . ,(buffer-name (current-buffer))) - (handler . man-bookmark-jump))) + (man-args . ,Man-arguments) + (handler . Man-bookmark-jump))) -(defun man-bookmark-jump (bookmark) +;;;###autoload +(defun Man-bookmark-jump (bookmark) "Default bookmark handler for Man buffers." - (let* ((buf (bookmark-prop-get bookmark 'buffer-name)) - (buf-lst (split-string buf)) - (node (replace-regexp-in-string "\*" "" (car (last buf-lst)))) - (ind (when (> (length buf-lst) 2) (second buf-lst))) - (Man-notify-method (case bookmark-jump-display-function - ('switch-to-buffer 'pushy) - ('switch-to-buffer-other-window 'friendly) - ('display-buffer 'quiet) - (t 'friendly)))) - (man (if ind (format "%s(%s)" node ind) node)) - (while (get-process "man") (sit-for 1)) + (let* ((man-args (bookmark-prop-get bookmark 'man-args)) + ;; Let bookmark.el do the window handling. + ;; This let-binding needs to be active during the call to both + ;; Man-getpage-in-background and accept-process-output. + (Man-notify-method 'meek) + (buf (Man-getpage-in-background man-args)) + (proc (get-buffer-process buf))) + (while (and proc (eq (process-status proc) 'run)) + (accept-process-output proc)) (bookmark-default-handler `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark))))) === modified file 'lisp/woman.el' --- lisp/woman.el 2010-04-12 15:17:29 +0000 +++ lisp/woman.el 2010-04-12 16:09:47 +0000 @@ -1897,6 +1897,7 @@ (setq woman-emulation value) (woman-reformat-last-file)) +(defvar bookmark-make-record-function) (put 'woman-mode 'mode-class 'special) (defun woman-mode () @@ -4520,18 +4521,29 @@ nil) ; for woman-file-readable-p etc. ;;; Bookmark Woman support. +(declare-function bookmark-make-record-default "bookmark" (&optional pos-only)) +(declare-function bookmark-prop-get "bookmark" (bookmark prop)) +(declare-function bookmark-default-handler "bookmark" (bmk)) +(declare-function bookmark-get-bookmark-record "bookmark" (bmk)) + +;; FIXME: woman.el and man.el should be better integrated so, for +;; example, bookmarks of one can be used with the other. (defun woman-bookmark-make-record () "Make a bookmark entry for a Woman buffer." - `(,(man-set-default-bookmark-title) + `(,(Man-default-bookmark-title) ,@(bookmark-make-record-default 'point-only) - (filename . ,woman-last-file-name) - (handler . woman-bookmark-jump))) - - + ;; Use the same form as man's bookmarks, as much as possible. + (man-args . ,woman-last-file-name) + (handler . woman-bookmark-jump))) + +;;;###autoload (defun woman-bookmark-jump (bookmark) "Default bookmark handler for Woman buffers." - (let* ((file (bookmark-prop-get bookmark 'filename)) + (let* ((file (bookmark-prop-get bookmark 'man-args)) + ;; FIXME: we need woman-find-file-noselect, since + ;; save-window-excursion can't protect us from the case where + ;; woman-find-file creates a new frame. (buf (save-window-excursion (woman-find-file file) (current-buffer)))) (bookmark-default-handler ------------------------------------------------------------ revno: 99881 author: Thierry Volpiatto committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-04-12 11:17:29 -0400 message: Summary: Add bookmark support for man, woman and gnus-summary. * woman.el (woman-bookmark-make-record, woman-bookmark-jump): New functions. (woman-mode): Setup bookmark support. * man.el (man-set-default-bookmark-title, man-bookmark-make-record) (man-bookmark-jump): New functions. (Man-mode): Setup bookmark support. * gnus-sum.el (gnus-summary-bookmark-make-record) (gnus-summary-bookmark-jump): New functions. (gnus-summary-mode): Setup bookmark support. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-04-10 23:54:50 +0000 +++ lisp/ChangeLog 2010-04-12 15:17:29 +0000 @@ -1,3 +1,13 @@ +2010-04-12 Thierry Volpiatto + + * woman.el (woman-bookmark-make-record, woman-bookmark-jump): + New functions. + (woman-mode): Setup bookmark support. + + * man.el (man-set-default-bookmark-title, man-bookmark-make-record) + (man-bookmark-jump): New functions. + (Man-mode): Setup bookmark support. + 2010-04-10 Jari Aalto * comint.el (comint-password-prompt-regexp): Use regexp-opt, and @@ -13,10 +23,9 @@ * net/tramp.el (tramp-completion-function-alist) (tramp-file-name-regexp, tramp-chunksize) - (tramp-local-coding-commands, tramp-remote-coding-commands): Fix - docstring. - (tramp-remote-process-environment): Use `format' instead of - `concat'. + (tramp-local-coding-commands, tramp-remote-coding-commands): + Fix docstring. + (tramp-remote-process-environment): Use `format' instead of `concat'. (tramp-handle-directory-files-and-attributes) (tramp-get-remote-path): Use `copy-tree'. (tramp-handle-file-name-all-completions): Backward/ XEmacs @@ -24,11 +33,11 @@ `read-file-name-completion-ignore-case' does not exist. (tramp-do-copy-or-rename-file-directly): Do not use `tramp-handle-file-remote-p'. - (tramp-do-copy-or-rename-file-out-of-band): Use - `tramp-compat-delete-directory'. + (tramp-do-copy-or-rename-file-out-of-band): + Use `tramp-compat-delete-directory'. (tramp-do-copy-or-rename-file-out-of-band) - (tramp-compute-multi-hops, tramp-maybe-open-connection): Use - `format-spec-make'. + (tramp-compute-multi-hops, tramp-maybe-open-connection): + Use `format-spec-make'. (tramp-find-foreign-file-name-handler) (tramp-advice-make-auto-save-file-name) (tramp-set-auto-save-file-modes): Remove superfluous check for @@ -38,8 +47,8 @@ (tramp-check-for-regexp): Use (forward-line 1). (tramp-set-auto-save-file-modes): Adapt version check. - * net/tramp-compat.el (tramp-advice-file-expand-wildcards): Wrap - call of `featurep' for 2nd argument. + * net/tramp-compat.el (tramp-advice-file-expand-wildcards): + Wrap call of `featurep' for 2nd argument. (tramp-compat-make-temp-file): Simplify fallback implementation. (tramp-compat-copy-tree): Remove function. (tramp-compat-delete-directory): Provide implementation for older @@ -69,8 +78,8 @@ Add --author support to git commit. * vc-git.el (vc-git-checkin): Pass extra-args to the commit command. (vc-git-log-edit-mode): New minor mode. - (log-edit-mode, log-edit-extra-flags, log-edit-mode): New - declarations. + (log-edit-mode, log-edit-extra-flags, log-edit-mode): + New declarations. 2010-04-09 Eric Raymond === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-04-03 01:54:24 +0000 +++ lisp/gnus/ChangeLog 2010-04-12 15:17:29 +0000 @@ -1,3 +1,9 @@ +2010-04-12 Thierry Volpiatto + + * gnus-sum.el (gnus-summary-bookmark-make-record) + (gnus-summary-bookmark-jump): New functions. + (gnus-summary-mode): Setup bookmark support. + 2010-04-01 Andreas Schwab * mm-uu.el (mm-uu-pgp-signed-extract-1): Use buffer-file-coding-system === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-03-23 07:37:09 +0000 +++ lisp/gnus/gnus-sum.el 2010-04-12 15:17:29 +0000 @@ -3072,6 +3072,9 @@ (gnus-run-mode-hooks 'gnus-summary-mode-hook) (turn-on-gnus-mailing-list-mode) (mm-enable-multibyte) + ;; Bookmark support. + (set (make-local-variable 'bookmark-make-record-function) + 'gnus-summary-bookmark-make-record) (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) (gnus-update-summary-mark-positions)) @@ -12640,6 +12643,38 @@ (gnus-summary-limit (gnus-sorted-nunion old new)))) (gnus-summary-position-point))) +;;; BOOKMARK support for GNUS. + +(defun gnus-summary-bookmark-make-record () + "Make a bookmark entry for a Gnus buffer." + (require 'gnus) + (unless (and (eq major-mode 'gnus-summary-mode) gnus-article-current) + (error "Please retry from the Gnus summary buffer")) ;[1] + (let* ((subject (elt (gnus-summary-article-header) 1)) + (grp (car gnus-article-current)) + (art (cdr gnus-article-current)) + (head (gnus-summary-article-header art)) + (id (mail-header-id head))) + `(,subject + ,@(bookmark-make-record-default 'point-only) + (group . ,grp) (article . ,art) + (message-id . ,id) (handler . gnus-summary-bookmark-jump)))) + + +(defun gnus-summary-bookmark-jump (bookmark) + "Handler function for record returned by `gnus-summary-bookmark-make-record'. +BOOKMARK is a bookmark name or a bookmark record." + (let ((group (bookmark-prop-get bookmark 'group)) + (article (bookmark-prop-get bookmark 'article)) + (id (bookmark-prop-get bookmark 'message-id)) + buf) + (gnus-fetch-group group (list article)) + (gnus-summary-insert-cached-articles) + (gnus-summary-goto-article id nil 'force) + (setq buf (current-buffer)) + (bookmark-default-handler + `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark))))) + (gnus-summary-make-all-marking-commands) (gnus-ems-redefine) === modified file 'lisp/man.el' --- lisp/man.el 2010-03-05 20:18:20 +0000 +++ lisp/man.el 2010-04-12 15:17:29 +0000 @@ -221,6 +221,11 @@ :type '(repeat string) :group 'man) +(defcustom Man-name-local-regexp "^NOM$" + "*The translation of the uppercase word NAME in your language. +Used in `bookmark-set' to get the default bookmark name." + :type 'string :group 'bookmark) + (defvar manual-program "man" "The name of the program that produces man pages.") @@ -1325,6 +1330,9 @@ (setq imenu-generic-expression (list (list nil Man-heading-regexp 0))) (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) + ;; Bookmark support. + (set (make-local-variable 'bookmark-make-record-function) + 'man-bookmark-make-record) (Man-build-page-list) (Man-strip-page-headers) (Man-unindent) @@ -1659,6 +1667,44 @@ (setq path nil)) (setq complete-path nil))) complete-path)) + +;;; Bookmark Man Support + +(defun man-set-default-bookmark-title () + "Set default bookmark title for Man or woman page based \ +on NAME or `Man-name-local-regexp' entry." + (save-excursion + (goto-char (point-min)) + (when (or (re-search-forward Man-name-local-regexp nil t) + (re-search-forward "^NAME$" nil t)) + (forward-line 1) + (unless (> (skip-chars-forward " ") 0) + (skip-chars-forward "\t")) + (buffer-substring-no-properties (point) (line-end-position))))) + +(defun man-bookmark-make-record () + "Make a bookmark entry for a Man buffer." + `(,(man-set-default-bookmark-title) + ,@(bookmark-make-record-default 'point-only) + (buffer-name . ,(buffer-name (current-buffer))) + (handler . man-bookmark-jump))) + +(defun man-bookmark-jump (bookmark) + "Default bookmark handler for Man buffers." + (let* ((buf (bookmark-prop-get bookmark 'buffer-name)) + (buf-lst (split-string buf)) + (node (replace-regexp-in-string "\*" "" (car (last buf-lst)))) + (ind (when (> (length buf-lst) 2) (second buf-lst))) + (Man-notify-method (case bookmark-jump-display-function + ('switch-to-buffer 'pushy) + ('switch-to-buffer-other-window 'friendly) + ('display-buffer 'quiet) + (t 'friendly)))) + (man (if ind (format "%s(%s)" node ind) node)) + (while (get-process "man") (sit-for 1)) + (bookmark-default-handler + `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark))))) + ;; Init the man package variables, if not already done. (Man-init-defvars) === modified file 'lisp/woman.el' --- lisp/woman.el 2010-03-16 17:24:44 +0000 +++ lisp/woman.el 2010-04-12 15:17:29 +0000 @@ -1934,6 +1934,9 @@ ;; `make-local-variable' in case imenu not yet loaded! woman-imenu-generic-expression) (set (make-local-variable 'imenu-space-replacement) " ") + ;; Bookmark support. + (set (make-local-variable 'bookmark-make-record-function) + 'woman-bookmark-make-record) ;; For reformat ... ;; necessary when reformatting a file in its old buffer: (setq imenu--last-menubar-index-alist nil) @@ -4516,6 +4519,24 @@ (recenter 0)))))))) nil) ; for woman-file-readable-p etc. +;;; Bookmark Woman support. + +(defun woman-bookmark-make-record () + "Make a bookmark entry for a Woman buffer." + `(,(man-set-default-bookmark-title) + ,@(bookmark-make-record-default 'point-only) + (filename . ,woman-last-file-name) + (handler . woman-bookmark-jump))) + + +(defun woman-bookmark-jump (bookmark) + "Default bookmark handler for Woman buffers." + (let* ((file (bookmark-prop-get bookmark 'filename)) + (buf (save-window-excursion + (woman-find-file file) (current-buffer)))) + (bookmark-default-handler + `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bookmark))))) + (provide 'woman) ;; arch-tag: eea35e90-552f-4712-a94b-d9ffd3db7651 ------------------------------------------------------------ revno: 99880 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-04-12 07:38:42 -0700 message: * Makefile.in (ALL_CFLAGS, LINK_CFLAGS, CPP_CFLAGS): Move to the non-cpp section. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-04-11 20:17:24 +0000 +++ lib-src/ChangeLog 2010-04-12 14:38:42 +0000 @@ -1,3 +1,8 @@ +2010-04-12 Dan Nicolaescu + + * Makefile.in (ALL_CFLAGS, LINK_CFLAGS, CPP_CFLAGS): Move to the + non-cpp section. + 2010-04-11 Dan Nicolaescu * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): Define using === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2010-04-11 20:17:24 +0000 +++ lib-src/Makefile.in 2010-04-12 14:38:42 +0000 @@ -152,6 +152,12 @@ ## Extra libraries to use when linking movemail. LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) +# Those files shared with other GNU utilities need HAVE_CONFIG_H +# defined before they know they can take advantage of the information +# in ../src/config.h. +ALL_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS} +LINK_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS} +CPP_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} # ========================== start of cpp stuff ======================= /* From here on, comments must be done in C syntax. */ @@ -185,15 +191,6 @@ LOADLIBES=LIBS_SYSTEM LIBS_MACHINE -/* Those files shared with other GNU utilities need HAVE_CONFIG_H - defined before they know they can take advantage of the information - in ../src/config.h. */ -ALL_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \ - -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS} -LINK_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \ - -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS} -CPP_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \ - -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS} .SUFFIXES: .m ------------------------------------------------------------ revno: 99879 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-04-12 07:32:10 -0700 message: * Makefile.in (C_SWITCH_SYSTEM,C_SWITCH_MACHINE,C_SWITCH_X_SITE): Undefine. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-04-11 21:43:28 +0000 +++ src/ChangeLog 2010-04-12 14:32:10 +0000 @@ -1,3 +1,7 @@ +2010-04-12 Dan Nicolaescu + + * Makefile.in (C_SWITCH_SYSTEM,C_SWITCH_MACHINE,C_SWITCH_X_SITE): Undefine. + 2010-04-11 Dan Nicolaescu Remove C_SWITCH_SYSTEM_TEMACS. === modified file 'src/Makefile.in' --- src/Makefile.in 2010-04-12 11:28:56 +0000 +++ src/Makefile.in 2010-04-12 14:32:10 +0000 @@ -94,6 +94,11 @@ DEPFLAGS = -MMD -MF deps/$*.d #endif +/* Undefine until the user can be moved in the non-cpp section. */ +#undef C_SWITCH_SYSTEM +#undef C_SWITCH_MACHINE +#undef C_SWITCH_X_SITE + /* Do not let the file name mktime.c get messed up. */ #ifdef mktime #undef mktime ------------------------------------------------------------ revno: 99878 committer: Jan D. branch nick: trunk timestamp: Mon 2010-04-12 13:28:56 +0200 message: Restore C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM. diff: === modified file 'src/Makefile.in' --- src/Makefile.in 2010-04-12 10:59:35 +0000 +++ src/Makefile.in 2010-04-12 11:28:56 +0000 @@ -256,7 +256,7 @@ /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM since it may have -I options that should override those two. */ -ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} +ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@ .SUFFIXES: .m ------------------------------------------------------------ revno: 99877 committer: Jan D. branch nick: trunk timestamp: Mon 2010-04-12 12:59:35 +0200 message: Change so emacs at least compiles. #undef C_SWITCH_MACHINE #undef C_SWITCH_SYSTEM #undef C_SWITCH_X_SITE diff: === modified file 'src/Makefile.in' --- src/Makefile.in 2010-04-11 21:43:28 +0000 +++ src/Makefile.in 2010-04-12 10:59:35 +0000 @@ -250,9 +250,13 @@ -DHAVE_CONFIG_H is needed for some other files to take advantage of the information in ``config.h''. */ +#undef C_SWITCH_MACHINE +#undef C_SWITCH_SYSTEM +#undef C_SWITCH_X_SITE + /* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM since it may have -I options that should override those two. */ -ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} +ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS} ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@ .SUFFIXES: .m ------------------------------------------------------------ revno: 99876 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-04-11 14:45:59 -0700 message: Remove C_SWITCH_SYSTEM_TEMACS. diff: === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2010-04-01 23:08:14 +0000 +++ admin/CPP-DEFINES 2010-04-11 21:45:59 +0000 @@ -106,7 +106,6 @@ CRT0_DUMMIES C_SWITCH_MACHINE C_SWITCH_SYSTEM -C_SWITCH_SYSTEM_TEMACS C_SWITCH_X_SYSTEM DATA_SEG_BITS DATA_START