Merge from emacs--devo--0

Patches applied:

 * emacs--devo--0  (patch 806-813)

   - Merge from emacs--rel--22
   - Update from CVS

 * emacs--rel--22  (patch 51-58)

   - Update from CVS
   - Merge from gnus--rel--5.10

 * gnus--rel--5.10  (patch 233-236)

   - Merge from emacs--devo--0
   - Update from CVS

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-230
This commit is contained in:
Miles Bader 2007-07-15 04:47:46 +00:00
commit 8c406a9bc4
101 changed files with 10660 additions and 7434 deletions

View file

@ -1,3 +1,24 @@
2007-07-15 Karl Fogel <kfogel@red-bean.com>
* NEWS: Revert 2007-07-13T23:20:21Z!kfogel@red-bean.com, which
documented bookmark keybinding changes that were later reverted.
2007-07-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* PROBLEMS: Mention gtk-engines-qt problem.
2007-07-13 Karl Fogel <kfogel@red-bean.com>
* NEWS: Update for recent bookmark keybinding changes.
2007-07-10 Michael Albinus <michael.albinus@gmx.de>
* NEWS: Add Tramp and comint-mode changes.
2007-07-08 Michael Albinus <michael.albinus@gmx.de>
* NEWS: `file-remote-p' has a new optional parameter CONNECTED.
2007-07-07 Michael Albinus <michael.albinus@gmx.de>
* NEWS: New function `start-file-process'.

View file

@ -73,6 +73,9 @@ recenter the visited source file. Its value can be a number (for example,
* Changes in Specialized Modes and Packages in Emacs 23.1
** compilation-auto-jump-to-first-error tells `compile' to jump to
the first error encountered during compilations.
** In the `copyright' package, you can specify your copyright holders's names.
Only copyright lines with holders matching copyright-names-regexp will be
considered for update.
@ -95,9 +98,49 @@ identify cited keys in BibTeX entries, used by `bibtex-find-crossref.
*** Command `bibtex-url' now allows multiple URLs per entry.
+++
** Tramp
*** New connection methods.
The new methods "plinkx", "plink2", "psftp", "sftp" and "fish" have
been introduced. There are also new so-called gateway methods
"tunnel" and "socks".
*** Multihop syntax has been removed.
The pseudo-method "multi" has been removed. Instead of, multi hops
can be specified by the new variable `tramp-default-proxies-alist'.
*** More default settings.
Default values can be set via the variables `tramp-default-user',
`tramp-default-user-alist' and `tramp-default-host'.
*** Connection information is cached.
In order to reduce connection setup, information about used
connections are kept persistent in a file. The name of this file is
defined in the variable `tramp-persistency-file-name'.
*** Control of remote processes.
Running processes on a remote host can be controlled by settings in
`tramp-remote-path' and `tramp-remote-process-environment'.
*** Success of remote copy is checked.
When the variable `file-precious-flag' is set, the success of a remote
file copy is checked via the file's checksum.
** comint-mode uses `start-file-process' now (see Lisp Changes).
If `default-directory' is a remote file name, subprocesses are started
on the corresponding remote system.
* Changes in Emacs 23.1 on non-free operating systems
---
** IPv6 is supported on MS-Windows.
Emacs now supports IPv6 on Windows XP and later, and earlier versions
of Windows with third party IPv6 stacks installed. Previously IPv6 was
supported on other platforms, but not on Windows due to using the winsock
1.1 header file, even though Emacs was linking to the winsock 2 library.
* Incompatible Lisp Changes in Emacs 23.1
@ -107,6 +150,16 @@ identify cited keys in BibTeX entries, used by `bibtex-find-crossref.
* Lisp Changes in Emacs 23.1
+++
** In `condition-case', a handler can specify "let the debugger run first".
You do this by writing `debug' in the list of conditions to be handled,
like this:
(condition-case nil
(foo bar)
((debug error) nil))
** The `require-match' argument to `completing-read' accepts a new value
`confirm-only'.
@ -126,6 +179,14 @@ with a given image specification.
but obeys file handlers. The file handler is chosen based on
`default-directory'.
+++
** `file-remote-p' has a new optional parameter CONNECTED.
With this paramter passed non-nil, it is checked whether a remote
connection has been established already.
** The two new functions `looking-at-p' and `string-match-p' can do
the same matching as `looking-at' and `string-match' without changing
the match data.
* New Packages for Lisp Programming in Emacs 23.1

View file

@ -46,6 +46,11 @@ before deleting/copying the indicated directory recursively.
than the window, the usual keys for moving the cursor cause the image
to be scrolled horizontally or vertically instead.
** Scrollbars follow the system theme on Windows XP and later.
Windows XP introduced themed scrollbars, but applications have to take
special steps to use them. Emacs now has the appropriate resources linked
in to make it use the scrollbars from the system theme.
* New Modes and Packages in Emacs 22.2
** The new package css-mode.el provides a major mode for editing CSS files.

View file

@ -1164,6 +1164,10 @@ present or commented out:
Emacs*Foreground
Emacs*Background
It is also reported that a bug in the gtk-engines-qt engine can cause this if
Emacs is compiled with Gtk+.
The bug is fixed in version 0.7 or newer of gtk-engines-qt.
*** KDE: Emacs hangs on KDE when a large portion of text is killed.
This is caused by a bug in the KDE applet `klipper' which periodically

View file

@ -1,5 +1,5 @@
% Reference Card for Org Mode
\def\orgversionnumber{5.01}
\def\orgversionnumber{5.03}
\def\versionyear{2007} % latest update
\def\year{2007} % latest copyright year
@ -544,6 +544,24 @@ \section{Tags}
\key{create sparse tree with matching tags}{C-c \\}
\key{globally (agenda) match tags at cursor}{C-c C-o}
\section{Properties and Column View}
\key{special commands in property lines}{C-c C-c}
\key{next/previous allowed value}{S-left/right}
\key{turn on column view}{C-c C-x C-c}
\key{quit column view}{q}
\key{next/previous allowed value}{S-left/right}
\key{next/previous allowed value}{n / p}
\key{edit value}{e}
\key{edit allowed values list}{a}
\key{show value}{v}
\key{make column wider/narrower}{> / <}
\key{move column left/right}{M-left/right}
\key{add new column}{M-S-right}
\key{Delete current column}{M-S-left}
\section{Timestamps}
\key{prompt for date and insert timestamp}{C-c .}
@ -566,6 +584,8 @@ \section{Timestamps}
%\key{... forward/backward one month}{M-S-LEFT/RIGT}
\key{Toggle custom format display for dates/times}{C-c C-x C-t}
\newcolumn
{\bf Clocking time}
\key{start clock on current item}{C-c C-x C-i}
@ -575,12 +595,6 @@ \section{Timestamps}
\key{remove displayed times}{C-c C-c}
\key{insert/update table with clock report}{C-c C-x C-r}
\section{LaTeX and cdlatex-mode}
\key{preview LaTeX fragment}{C-c C-x C-l}
\key{Expand abbreviation (cdlatex-mode)}{TAB}
\key{Insert/modify math symbol (cdlatex-mode)}{` / '}
\section{Agenda Views}
\key{add/move current file to front of agenda}{C-c [}
@ -648,6 +662,7 @@ \section{Agenda Views}
\key{change timestamp to today}{>}
\key{insert new entry into diary}{i}
\newcolumn
\key{start the clock on current item (clock-in)}{I}
\key{stop the clock (clock-out)}{O}
\key{cancel current clock}{X}
@ -656,7 +671,6 @@ \section{Agenda Views}
\key{Open link in current line}{C-c C-o}
\newcolumn
{\bf Calendar commands}
\key{find agenda cursor date in calendar}{c}
@ -678,6 +692,12 @@ \section{Calendar and Diary Integration}
(setq org-agenda-include-diary t)
\endexample
\section{LaTeX and cdlatex-mode}
\key{preview LaTeX fragment}{C-c C-x C-l}
\key{Expand abbreviation (cdlatex-mode)}{TAB}
\key{Insert/modify math symbol (cdlatex-mode)}{` / '}
\section{Exporting and Publishing}
Exporting creates files with extensions {\it .txt\/} and {\it .html\/}
@ -690,17 +710,17 @@ \section{Exporting and Publishing}
\key{insert template of export options}{C-c C-x t}
\key{toggle fixed width for entry or region}{C-c :}
{\bf HTML formatting}
%{\bf HTML formatting}
\key{make words {\bf bold}}{*bold*}
\key{make words {\it italic}}{/italic/}
\key{make words \underbar{underlined}}{_underlined_}
\key{sub- and superscripts}{x\^{}3, J_dust}
\key{\TeX{}-like macros}{\\alpha, \\to}
\key{typeset lines in fixed width font}{start with :}
\key{tables are exported as HTML tables}{start with |}
\key{links become HTML links}{http:... etc}
\key{include html tags}{@<b>...@</b>}
%\key{make words {\bf bold}}{*bold*}
%\key{make words {\it italic}}{/italic/}
%\key{make words \underbar{underlined}}{_underlined_}
%\key{sub- and superscripts}{x\^{}3, J_dust}
%\key{\TeX{}-like macros}{\\alpha, \\to}
%\key{typeset lines in fixed width font}{start with :}
%\key{tables are exported as HTML tables}{start with |}
%\key{links become HTML links}{http:... etc}
%\key{include html tags}{@<b>...@</b>}
%{\bf Export options}
%

View file

@ -1,3 +1,325 @@
2007-07-15 Karl Fogel <kfogel@red-bean.com>
* bookmark.el: Revert 2007-07-13T18:16:17Z!kfogel@red-bean.com,
thus restoring bookmark bindings to three slots under C-x r. See
http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00705.html.
2007-07-15 Jeff Miller <jmiller@cablespeed.com> (tiny change)
* calendar/cal-bahai.el (calendar-goto-bahai-date): Add autoload
cookie.
2007-07-15 Jason Rumney <jasonr@gnu.org>
* w32-fns.el (set-default-process-coding-system): Use dos line ends
for input to cmdproxy on all versions of Windows.
Use dos line ends for input to plink.
* comint.el (comint-simple-send): Concat newline before sending.
(comint-password-prompt-regexp): Recognize plink's passphrase prompt.
2007-07-14 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/autoload.el (generated-autoload-file): Autoload the
safe-local-variable setting.
2007-07-14 David Kastrup <dak@gnu.org>
* emacs-lisp/advice.el (defadvice): Doc fix.
2007-07-14 Juanma Barranquero <lekktu@gmail.com>
* subr.el (when, unless): Doc fix.
2007-07-13 Dan Nicolaescu <dann@ics.uci.edu>
* replace.el (match): Use yellow1 instead of yellow.
* progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of
red.
* pcvs-info.el (cvs-unknown): Likewise.
2007-07-13 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (install-lisp-SH, install-lisp-CMD): New targets.
(install): Use them to copy all *.el files before *.elc.
2007-07-13 Drew Adams <drew.adams@oracle.com>
* bookmark.el (bookmark-jump-other-window): New function.
(bookmark-map): Bind it to "o".
http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00633.html
and its thread contains discussion about this change.
The original patch was slightly tweaked by Karl Fogel
<kfogel@red-bean.com> before committing.
2007-07-13 Karl Fogel <kfogel@red-bean.com>
* bookmark.el: Shorten some comments to fit within 80 lines.
2007-07-13 Karl Fogel <kfogel@red-bean.com>
* bookmark.el: Don't define bookmark keys under the "C-xr" map;
instead, make "C-xp" a prefix for bookmark-map. Patch by Drew
Adams <drew.adams@oracle.com>, mildly tweaked by me. See
http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00633.html.
2007-07-13 Carsten Dominik <dominik@science.uva.nl>
* textmodes/org.el: Bug fixes.
(org-end-of-line): Move to end of line if in headline without tags.
2007-07-13 Stefan Monnier <monnier@iro.umontreal.ca>
* vc-hooks.el: Remove spurious * in docstrings.
(vc-handled-backends): Add BZR.
* vc-hooks.el (vc-find-file-hook): Use with-demoted-errors.
2007-07-12 Davis Herring <herring@lanl.gov>
* desktop.el (desktop-buffer-info, desktop-save):
Use `desktop-dirname' instead of `dirname'.
2007-07-12 Paul Pogonyshev <pogonyshev@gmx.net>
* progmodes/which-func.el (which-func-modes): Add `python-mode'.
* progmodes/python.el (python-which-func-length-limit): New var.
(python-which-func): New function.
(python-current-defun): Add optional `length-limit' and try to fit
computed function name to that length.
(python-mode): Hook `python-which-func' up.
2007-07-12 Sean O'Rourke <sorourke@cs.ucsd.edu> (tiny change)
* pcomplete.el (pcomplete-entries): Obey pcomplete-ignore-case.
* comint.el (comint-dynamic-complete-as-filename):
Use read-file-name-completion-ignore-case.
2007-07-12 Stefan Monnier <monnier@iro.umontreal.ca>
* comint.el (comint-dynamic-list-filename-completions):
Use read-file-name-completion-ignore-case.
* vc-cvs.el: Require CL.
(vc-cvs-revision-table, vc-cvs-revision-completion-table):
New functions to provide completion of revision names.
* vc-cvs.el (vc-functions): Clear up the cache when reloading the file.
(vc-cvs-annotate-first-line-re): New const.
(vc-cvs-annotate-process-filter): New fun.
(vc-cvs-annotate-command): Use them and run the command asynchronously.
2007-07-12 Paul Pogonyshev <pogonyshev@gmx.net>
* emacs-lisp/eldoc.el (eldoc-last-data): Revise documentation.
(eldoc-print-current-symbol-info): Adjust for changed helper
function signatures.
(eldoc-get-fnsym-args-string): Add `args' argument. Use new
`eldoc-highlight-function-argument'.
(eldoc-highlight-function-argument): New function.
(eldoc-get-var-docstring): Format documentation with
`font-lock-variable-name-face'.
(eldoc-docstring-format-sym-doc): Add `face' argument and apply it
where suited.
(eldoc-fnsym-in-current-sexp): Return a list with argument index.
(eldoc-beginning-of-sexp): Return number of skipped sexps.
2007-07-11 Michael Albinus <michael.albinus@gmx.de>
* progmodes/compile.el (compilation-start): `start-process' must
still be redefined when calling `start-process-shell-command'.
* progmodes/gud.el (gud-file-name): When `default-directory' is a
remote file name, prepend its remote part to the filename.
(gud-common-init): When `default-directory' is a remote file name,
make the filename relative to it.
Based on a patch by Nick Roberts <nickrob@snap.net.nz>.
2007-07-11 Dan Nicolaescu <dann@ics.uci.edu>
* vc-hooks.el (vc-default-mode-line-string): Add a mouse face,
mouse binding and a tooltip.
2007-07-11 Stefan Monnier <monnier@iro.umontreal.ca>
* menu-bar.el (vc-menu-map): New defalias.
2007-07-10 Richard Stallman <rms@gnu.org>
* emacs-lisp/lisp-mode.el (eval-defun):
Explain special handling of `defface'.
2007-07-10 Jim Meyering <jim@meyering.net> (tiny change)
* emacs-lisp/copyright.el (copyright-current-gpl-version): Set to 3.
* autoinsert.el (auto-insert-alist): s/2/3/ in the generated comment.
2007-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl.el: Load cl-loaddefs.el quietly.
* vc-arch.el (vc-arch-complete): Remove.
(vc-arch-revision-completion-table): Use complete-with-action.
* subr.el (condition-case-no-debug, with-demoted-errors): New macros.
(complete-with-action): New function.
(dynamic-completion-table): Use it.
2007-07-10 Michael Albinus <michael.albinus@gmx.de>
* comint.el (make-comint, make-comint-in-buffer)
(comint-exec-1): Replace `start-process' by `start-file-process'.
* progmodes/compile.el (compilation-start): Revert redefining
`start-process'.
2007-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/autoload.el (autoload-generate-file-autoloads): Be careful
with EOLs when generating MD5 checksums.
* follow.el: Don't change the global map from the follow-mode-map
defvar, but from the toplevel. Use easy-menu to unify the Emacs and
XEmacs code.
(turn-on-follow-mode, turn-off-follow-mode): Remove interactive spec
since `follow-mode' should be used instead for that.
* emacs-lisp/easymenu.el (easy-menu-binding): New function.
(easy-menu-do-define): Use it.
(easy-menu-do-add-item): Inline into easy-menu-add-item and then remove.
* progmodes/compile.el (compilation-auto-jump-to-first-error)
(compilation-auto-jump-to-next): New vars.
(compilation-auto-jump): New function.
(compilation-error-properties): Use them to jump to first error.
(compilation-start): Set the var if requested.
* emacs-lisp/autoload.el (update-directory-autoloads): Remove
duplicates without also removing entries from other directories.
2007-07-10 Carsten Dominik <dominik@science.uva.nl>
* textmodes/org.el (org-agenda-day-view, org-agenda-week-view):
Remember span as default.
(org-columns-edit-value): Rename from `org-column-edit'.
(org-columns-display-here-title): Rename from
`org-overlay-columns-title'.
(org-columns-remove-overlays): Rename from org-remove-column-overlays.
(org-columns-get-autowidth-alist): Rename from
`org-get-columns-autowidth-alist'.
(org-columns-display-here): Rename from `org-overlay-columns'.
(org-columns-new-overlay): Rename from `org-new-column-overlay'.
(org-columns-quit): Rename from `org-column-quit'.
(org-columns-show-value): Rename from `org-column-show-value'.
(org-columns-content, org-columns-widen)
(org-columns-next-allowed-value)
(org-columns-edit-allowed, org-columns-store-format)
(org-columns-uncompile-format, org-columns-redo)
(org-columns-edit-attributes, org-delete-property)
(org-set-property, org-columns-update)
(org-columns-compute, org-columns-eval)
(org-columns-not-in-agenda, org-columns-compute-all)
(org-property-next-allowed-value)
(org-columns-compile-format)
(org-fill-paragraph-experimental)
(org-string-to-number, org-property-action)
(org-columns-move-left, org-columns-new )
(org-column-number-to-string)
(org-property-previous-allowed-value)
(org-at-property-p, org-columns-delete)
(org-columns-previous-allowed-value)
(org-columns-move-right, org-columns-narrow)
(org-property-get-allowed-values)
(org-verify-version, org-column-string-to-number)
(org-delete-property-globally): New functions.
(org-columns-current-fmt): Rename from `org-current-columns-fmt'.
(org-columns-overlays): Rename from `org-column-overlays'.
(org-columns-map): Rename from `org-column-map'.
(org-columns-current-maxwidths): Rename from
`org-current-columns-maxwidths'.
(org-columns-begin-marker, org-columns-current-fmt-compiled)
(org-previous-header-line-format)
(org-columns-inhibit-recalculation)
(org-columns-top-level-marker): New variables.
(org-columns-default-format): Rename from `org-default-columns-format'.
(org-property-re): New constant.
2007-07-10 Guanpeng Xu <herberteuler@hotmail.com>
* subr.el (looking-at-p, string-match-p): New functions.
2007-07-09 Reiner Steib <Reiner.Steib@gmx.de>
* textmodes/tex-mode.el (tex-fontify-script)
(tex-font-script-display): New variables to make display of
superscripts and subscripts customizable.
(tex-font-lock-suscript, tex-font-lock-match-suscript): Use them.
2007-07-09 Richard Stallman <rms@gnu.org>
* isearch.el (isearch-edit-string): Call to isearch-push-state
after the search.
2007-07-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* window.el (fit-window-to-buffer): Remove setting of window-min-height
to 1 as enlarge-window uses the value to resize/shrink windows other
than WINDOW if needed.
2007-07-08 Katsumi Yamaoka <yamaoka@jpl.org>
* cus-start.el (file-coding-system-alist): Fix custom type.
2007-07-08 Chong Yidong <cyd@stupidchicken.com>
* longlines.el (longlines-wrap-region): Avoid marking buffer as
modified.
(longlines-auto-wrap, longlines-window-change-function):
Remove unnecessary calls to set-buffer-modified-p.
2007-07-08 Katsumi Yamaoka <yamaoka@jpl.org>
* cus-start.el (file-coding-system-alist): Fix custom type.
2007-07-08 Stefan Monnier <monnier@iro.umontreal.ca>
* vc-cvs.el (vc-cvs-revert): Use vc-default-revert.
(vc-cvs-checkout): Remove last arg now unused; simplify.
2007-07-08 Michael Albinus <michael.albinus@gmx.de>
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
* net/tramp.el:
* net/tramp-ftp.el:
* net/tramp-smb.el:
* net/tramp-uu.el:
* net/trampver.el: Migrate to Tramp 2.1.
* net/tramp-cache.el:
* net/tramp-fish.el:
* net/tramp-gw.el: New Tramp packages.
* net/tramp-util.el:
* net/tramp-vc.el: Removed.
* net/ange-ftp.el: Add ange-ftp property to 'start-file-process
(ange-ftp-file-remote-p): Handle optional parameter CONNECTED.
* net/rcompile.el (remote-compile): Handle Tramp 2.1 arguments.
* progmodes/compile.el (compilation-start): Redefine
`start-process' temporarily when `default-directory' is remote.
Remove case of synchronous compilation, this won't happen ever.
(compilation-setup): Make local variable `comint-file-name-prefix'
for remote compilation.
2007-07-08 Martin Rudalics <rudalics@gmx.at>
* novice.el (disabled-command-function): Fit window to buffer to
@ -16,20 +338,21 @@
(math-bignum-digit-power-of-two): Evaluate when compiled.
* calc/calc-comb.el (math-small-factorial-table)
(math-init-random-base,math-prime-test): Remove unnecessary calls
(math-init-random-base, math-prime-test): Remove unnecessary calls
to `math-read-number-simple'.
* calc/calc-ext.el (math-approx-pi,math-approx-sqrt-e)
* calc/calc-ext.el (math-approx-pi, math-approx-sqrt-e)
(math-approx-gamma-const): Add docstrings.
* calc/calc-forms.el (math-julian-date-beginning)
(math-julian-date-beginning-int) New constants.
(math-format-date-part,math-parse-standard-date,calcFunc-julian):
(math-julian-date-beginning-int): New constants.
(math-format-date-part, math-parse-standard-date, calcFunc-julian):
Use the new constants.
* calc/calc-funcs.el (math-gammap1-raw): Add docstring.
* calc/calc-math.el (math-approx-ln-10,math-approx-ln-2): Add docstrings.
* calc/calc-math.el (math-approx-ln-10, math-approx-ln-2):
Add docstrings.
2007-07-07 Tom Tromey <tromey@redhat.com>
@ -106,8 +429,8 @@
* calc/calc-bin.el (math-bignum-logb-digit-size)
(math-bignum-digit-power-of-two): New constants.
(math-and-bignum,math-or-bignum,math-xor-bignum,math-diff-bignum)
(math-not-bignum,math-clip-bignum): Use the constants
(math-and-bignum, math-or-bignum, math-xor-bignum, math-diff-bignum)
(math-not-bignum, math-clip-bignum): Use the constants
`math-bignum-digit-power-of-two' and `math-bignum-logb-digit-size'
instead of their values.
(math-clip): Use math-small-integer-size instead of its value.
@ -186,6 +509,11 @@
* calculator.el (calculator-expt): Use more cases to determine
the value.
2007-07-03 Dan Nicolaescu <dann@ics.uci.edu>
* progmodes/gud.el (auto-mode-alist): Match more valid gdb init
file names.
2007-07-03 Jay Belanger <jay.p.belanger@gmail.com>
* calculator.el (calculator-expt, calculator-integer-p):
@ -261,12 +589,16 @@
2007-07-02 Martin Rudalics <rudalics@gmx.at>
* help-mode.el (help-make-xrefs): Skip spaces too when
* help-mode.el (help-make-xrefs): Skip spaces too when
skipping tabs.
* ffap.el (dired-at-point-prompter): Improve prompt in
list-directory case.
2007-07-01 Richard Stallman <rms@gnu.org>
* files.el (find-file-visit-truename): Fix safe-local-variable value.
2007-07-01 Richard Stallman <rms@gnu.org>
* cus-start.el (max-mini-window-height): Added.
@ -918,7 +1250,7 @@
post-command-hook.
(rcirc-window-configuration-change-1): Update mode-line and
overlay arrows here.
(rcirc-authenticate): Fix chanserv identification.
(rcirc-authenticate): Fixc hanserv identification.
(rcirc-default-server): Remove variable.
(rcirc): Connect according to rcirc-connections.
(rcirc-connections): Add variable.
@ -1536,7 +1868,7 @@
* files.el (auto-mode-alist): Open `.asd' files in lisp-mode.
2007-05-22 Katsumi Yamaoka <yamaoka@jpl.org> (tiny change)
2007-05-22 Katsumi Yamaoka <yamaoka@jpl.org>
* mail/mail-extr.el (mail-extract-address-components):
Recognize non-ASCII characters except for NBSP as words.

View file

@ -1340,7 +1340,7 @@
(shell-directory-tracker): Make regexp used for skipping to next
command correspond to one used for command itself.
2003-06-13 Katsumi Yamaoka <yamaoka@jpl.org> (tiny change)
2003-06-13 Katsumi Yamaoka <yamaoka@jpl.org>
* textmodes/texinfmt.el (texinfo-format-scan):
Silence `whitespace-cleanup'.
@ -11805,7 +11805,7 @@
* vc-hooks.el (vc-kill-buffer-hook): Add it to kill-buffer-hook again.
2002-08-22 Katsumi Yamaoka <yamaoka@jpl.org> (tiny change)
2002-08-22 Katsumi Yamaoka <yamaoka@jpl.org>
* frame.el (select-frame-by-name, select-frame-set-input-focus):
Always call x-focus-frame, if using x.

View file

@ -5295,7 +5295,7 @@
(reb-lisp-syntax-p, reb-change-syntax): `rx' is a Lisp syntax.
(reb-cook-regexp): Call `rx-to-string' when `re-reb-syntax' is `rx'.
2004-08-05 Katsumi Yamaoka <yamaoka@jpl.org> (tiny change)
2004-08-05 Katsumi Yamaoka <yamaoka@jpl.org>
* mail/mail-extr.el (mail-extr-disable-voodoo): New variable.
(mail-extr-voodoo): Check mail-extr-disable-voodoo.

View file

@ -1092,8 +1092,8 @@
North American rule. Replace "daylight savings" with "daylight
saving" in doc.
* calendar/cal-china.el,cal-dst.el,calendar.el,diary-lib.el:
* calendar/lunar.el,solar.el: Replace "daylight savings" with
* calendar/cal-china.el, cal-dst.el, calendar.el, diary-lib.el:
* calendar/lunar.el, solar.el: Replace "daylight savings" with
"daylight saving" in text.
* woman.el (woman-change-fonts): Tweak previous change by using
@ -8709,7 +8709,7 @@
* term.el (term-handle-scroll, term-delete-lines)
(term-insert-lines): Fix off by one errors.
2006-06-15 Katsumi Yamaoka <yamaoka@jpl.org> (tiny change)
2006-06-15 Katsumi Yamaoka <yamaoka@jpl.org>
* net/tramp.el (tramp-touch): Use UTC to express time.
@ -22969,7 +22969,7 @@
* menu-bar.el (menu-bar-showhide-menu): Add `showhide-battery'.
2005-08-09 Katsumi Yamaoka <yamaoka@jpl.org> (tiny change)
2005-08-09 Katsumi Yamaoka <yamaoka@jpl.org>
* net/ange-ftp.el (ange-ftp-send-cmd): Make it work properly with
uploading files.

View file

@ -188,7 +188,7 @@ If this contains a %s, that will be replaced by the matching rule."
\;; This file is free software; you can redistribute it and/or modify
\;; it under the terms of the GNU General Public License as published by
\;; the Free Software Foundation; either version 2, or (at your option)
\;; the Free Software Foundation; either version 3, or (at your option)
\;; any later version.
\;; This file is distributed in the hope that it will be useful,

View file

@ -240,12 +240,13 @@ functions have a binding in this keymap.")
;; Read the help on all of these functions for details...
;;;###autoload (define-key bookmark-map "x" 'bookmark-set)
;;;###autoload (define-key bookmark-map "m" 'bookmark-set) ; "m" for "mark"
;;;###autoload (define-key bookmark-map "m" 'bookmark-set) ;"m"ark
;;;###autoload (define-key bookmark-map "j" 'bookmark-jump)
;;;###autoload (define-key bookmark-map "g" 'bookmark-jump) ; "g" for "go"
;;;###autoload (define-key bookmark-map "g" 'bookmark-jump) ;"g"o
;;;###autoload (define-key bookmark-map "o" 'bookmark-jump-other-window)
;;;###autoload (define-key bookmark-map "i" 'bookmark-insert)
;;;###autoload (define-key bookmark-map "e" 'edit-bookmarks)
;;;###autoload (define-key bookmark-map "f" 'bookmark-insert-location) ; "f" for "find"
;;;###autoload (define-key bookmark-map "f" 'bookmark-insert-location) ;"f"ind
;;;###autoload (define-key bookmark-map "r" 'bookmark-rename)
;;;###autoload (define-key bookmark-map "d" 'bookmark-delete)
;;;###autoload (define-key bookmark-map "l" 'bookmark-load)
@ -1083,6 +1084,27 @@ of the old one in the permanent bookmark record."
(bookmark-show-annotation bookmark)))))
;;;###autoload
(defun bookmark-jump-other-window (bookmark)
"Jump to BOOKMARK (a point in some file) in another window.
See `bookmark-jump'."
(interactive
(let ((bkm (bookmark-completing-read "Jump to bookmark (in another window)"
bookmark-current-bookmark)))
(if (> emacs-major-version 21)
(list bkm) bkm)))
(when bookmark
(bookmark-maybe-historicize-string bookmark)
(let ((cell (bookmark-jump-noselect bookmark)))
(and cell
(switch-to-buffer-other-window (car cell))
(goto-char (cdr cell))
(if bookmark-automatically-show-annotations
;; if there is an annotation for this bookmark,
;; show it in a buffer.
(bookmark-show-annotation bookmark))))))
(defun bookmark-file-or-variation-thereof (file)
"Return FILE (a string) if it exists, or return a reasonable
variation of FILE if that exists. Reasonable variations are checked

View file

@ -149,6 +149,7 @@ Defaults to today's date if DATE is not given."
(message "Baha'i date: %s"
(calendar-bahai-date-string (calendar-cursor-to-date t))))
;;;###autoload
(defun calendar-goto-bahai-date (date &optional noecho)
"Move cursor to Baha'i date DATE.
Echo Baha'i date unless NOECHO is t."

View file

@ -333,12 +333,13 @@ This variable is buffer-local."
;; kinit prints a prompt like `Password for devnull@GNU.ORG: '.
;; ksu prints a prompt like `Kerberos password for devnull/root@GNU.ORG: '.
;; ssh-add prints a prompt like `Enter passphrase: '.
;; plink prints a prompt like `Passphrase for key "root@GNU.ORG": '.
;; Some implementations of passwd use "Password (again)" as the 2nd prompt.
(defcustom comint-password-prompt-regexp
"\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|\
Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\)\
\[Pp]assword\\( (again)\\)?\\|\
pass phrase\\|\\(Enter\\|Repeat\\|Bad\\) passphrase\\)\
pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\
\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'"
"*Regexp matching prompts for passwords in the inferior process.
This is used by `comint-watch-for-password-prompt'."
@ -670,13 +671,13 @@ BUFFER can be either a buffer or the name of one."
"Make a Comint process NAME in BUFFER, running PROGRAM.
If BUFFER is nil, it defaults to NAME surrounded by `*'s.
PROGRAM should be either a string denoting an executable program to create
via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP
connection to be opened via `open-network-stream'. If there is already a
running process in that buffer, it is not restarted. Optional fourth arg
via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting
a TCP connection to be opened via `open-network-stream'. If there is already
a running process in that buffer, it is not restarted. Optional fourth arg
STARTFILE is the name of a file to send the contents of to the process.
If PROGRAM is a string, any more args are arguments to PROGRAM."
(or (fboundp 'start-process)
(or (fboundp 'start-file-process)
(error "Multi-processing is not supported for this system"))
(setq buffer (get-buffer-create (or buffer (concat "*" name "*"))))
;; If no process, or nuked process, crank up a new one and put buffer in
@ -693,9 +694,9 @@ If PROGRAM is a string, any more args are arguments to PROGRAM."
"Make a Comint process NAME in a buffer, running PROGRAM.
The name of the buffer is made by surrounding NAME with `*'s.
PROGRAM should be either a string denoting an executable program to create
via `start-process', or a cons pair of the form (HOST . SERVICE) denoting a TCP
connection to be opened via `open-network-stream'. If there is already a
running process in that buffer, it is not restarted. Optional third arg
via `start-file-process', or a cons pair of the form (HOST . SERVICE) denoting
a TCP connection to be opened via `open-network-stream'. If there is already
a running process in that buffer, it is not restarted. Optional third arg
STARTFILE is the name of a file to send the contents of the process to.
If PROGRAM is a string, any more args are arguments to PROGRAM."
@ -781,17 +782,17 @@ buffer. The hook `comint-exec-hook' is run after each exec."
;; If the command has slashes, make sure we
;; first look relative to the current directory.
(cons default-directory exec-path) exec-path)))
(setq proc (apply 'start-process name buffer command switches)))
(setq proc (apply 'start-file-process name buffer command switches)))
(let ((coding-systems (process-coding-system proc)))
(setq decoding (car coding-systems)
encoding (cdr coding-systems)))
;; If start-process decided to use some coding system for decoding
;; If start-file-process decided to use some coding system for decoding
;; data sent from the process and the coding system doesn't
;; specify EOL conversion, we had better convert CRLF to LF.
(if (vectorp (coding-system-eol-type decoding))
(setq decoding (coding-system-change-eol-conversion decoding 'dos)
changed t))
;; Even if start-process left the coding system for encoding data
;; Even if start-file-process left the coding system for encoding data
;; sent from the process undecided, we had better use the same one
;; as what we use for decoding. But, we should suppress EOL
;; conversion.
@ -1953,11 +1954,16 @@ If this takes us past the end of the current line, don't skip at all."
"Default function for sending to PROC input STRING.
This just sends STRING plus a newline. To override this,
set the hook `comint-input-sender'."
(comint-send-string proc string)
(if comint-input-sender-no-newline
(if (not (string-equal string ""))
(process-send-eof))
(comint-send-string proc "\n")))
(let ((send-string
(if comint-input-sender-no-newline
string
;; Sending as two separate strings does not work
;; on Windows, so concat the \n before sending.
(concat string "\n"))))
(comint-send-string proc send-string))
(if (and comint-input-sender-no-newline
(not (string-equal string "")))
(process-send-eof)))
(defun comint-line-beginning-position ()
"Return the buffer position of the beginning of the line, after any prompt.
@ -2805,7 +2811,7 @@ Returns t if successful."
(defun comint-dynamic-complete-as-filename ()
"Dynamically complete at point as a filename.
See `comint-dynamic-complete-filename'. Returns t if successful."
(let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
(let* ((completion-ignore-case read-file-name-completion-ignore-case)
(completion-ignored-extensions comint-completion-fignore)
;; If we bind this, it breaks remote directory tracking in rlogin.el.
;; I think it was originally bound to solve file completion problems,
@ -2934,7 +2940,7 @@ See also `comint-dynamic-complete-filename'."
(defun comint-dynamic-list-filename-completions ()
"List in help buffer possible completions of the filename at point."
(interactive)
(let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
(let* ((completion-ignore-case read-file-name-completion-ignore-case)
;; If we bind this, it breaks remote directory tracking in rlogin.el.
;; I think it was originally bound to solve file completion problems,
;; but subsequent changes may have made this unnecessary. sm.

View file

@ -125,8 +125,11 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
:value (undecided . undecided)
(coding-system :tag "Decoding")
(coding-system :tag "Encoding"))
(coding-system :tag "Single coding system"
:value undecided)
(coding-system
:tag "Single coding system"
:value undecided
:match (lambda (widget value)
(and value (not (functionp value)))))
(function :value ignore))))
(selection-coding-system mule coding-system)
;; dired.c

View file

@ -652,7 +652,7 @@ is nil, ask the user where to save the desktop."
(set-buffer buffer)
(list
;; basic information
(desktop-file-name (buffer-file-name) dirname)
(desktop-file-name (buffer-file-name) desktop-dirname)
(buffer-name)
major-mode
;; minor modes
@ -673,7 +673,7 @@ is nil, ask the user where to save the desktop."
buffer-read-only
;; auxiliary information
(when (functionp desktop-save-buffer)
(funcall desktop-save-buffer dirname))
(funcall desktop-save-buffer desktop-dirname))
;; local variables
(let ((locals desktop-locals-to-save)
(loclist (buffer-local-variables))
@ -897,7 +897,7 @@ See also `desktop-base-file-name'."
(insert "\n " (desktop-value-to-string e)))
(insert ")\n\n")))
(setq default-directory dirname)
(setq default-directory desktop-dirname)
(let ((coding-system-for-write 'emacs-mule))
(write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage))
;; We remember when it was modified (which is presumably just now).

View file

@ -3759,7 +3759,7 @@ The syntax of `defadvice' is as follows:
\(defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...)
[DOCSTRING] [INTERACTIVE-FORM]
BODY... )
BODY...)
FUNCTION ::= Name of the function to be advised.
CLASS ::= `before' | `around' | `after' | `activation' | `deactivation'.

View file

@ -41,6 +41,7 @@
A `.el' file can set this in its local variables section to make its
autoloads go somewhere else. The autoload file is assumed to contain a
trailer starting with a FormFeed character.")
;;;###autoload
(put 'generated-autoload-file 'safe-local-variable 'stringp)
;; This feels like it should be a defconst, but MH-E sets it to
@ -432,7 +433,10 @@ Return non-nil iff FILE adds no autoloads to OUTFILE
;; checksum in secondary autoload files where we do
;; not need the time-stamp optimization because it is
;; already provided by the primary autoloads file.
(md5 secondary-autoloads-file-buf nil nil 'emacs-mule)
(md5 secondary-autoloads-file-buf
;; We'd really want to just use
;; `emacs-internal' instead.
nil nil 'emacs-mule-unix)
(nth 5 (file-attributes relfile))))
(insert ";;; Generated autoloads from " relfile "\n"))
(insert generate-autoload-section-trailer))))
@ -559,6 +563,7 @@ directory or directories specified."
(directory-files (expand-file-name dir)
t files-re))
dirs)))
(done ())
(this-time (current-time))
;; Files with no autoload cookies or whose autoloads go to other
;; files because of file-local autoload-generated-file settings.
@ -592,10 +597,10 @@ directory or directories specified."
(push file no-autoloads)
(setq files (delete file files)))))))
((not (stringp file)))
((not (and (file-exists-p file)
;; Remove duplicates as well, just in case.
(member file files)))
;; Remove the obsolete section.
((or (not (file-exists-p file))
;; Remove duplicates as well, just in case.
(member file done))
;; Remove the obsolete section.
(autoload-remove-section (match-beginning 0)))
((not (time-less-p (nth 4 form)
(nth 5 (file-attributes file))))
@ -606,6 +611,7 @@ directory or directories specified."
(if (autoload-generate-file-autoloads
file (current-buffer) buffer-file-name)
(push file no-autoloads))))
(push file done)
(setq files (delete file files)))))
;; Elements remaining in FILES have no existing autoload sections yet.
(dolist (file files)

View file

@ -10,8 +10,7 @@
;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p
;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively
;;;;;; notevery notany every some mapcon mapcan mapl maplist map
;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" (18050
;;;;;; 46455))
;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "47c92504dda976a632c2c10bedd4b6a4")
;;; Generated autoloads from cl-extra.el
(autoload (quote coerce) "cl-extra" "\
@ -284,7 +283,7 @@ Not documented
;;;;;; do* do loop return-from return block etypecase typecase ecase
;;;;;; case load-time-value eval-when destructuring-bind function*
;;;;;; defmacro* defun* gentemp gensym cl-compile-time-init) "cl-macs"
;;;;;; "cl-macs.el" (18051 52572))
;;;;;; "cl-macs.el" "7ccc827d272482ca276937ca18a7895a")
;;; Generated autoloads from cl-macs.el
(autoload (quote cl-compile-time-init) "cl-macs" "\
@ -746,7 +745,7 @@ Not documented
;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not
;;;;;; substitute-if substitute delete-duplicates remove-duplicates
;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove*
;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" (18050 45841))
;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "8805f76626399794931f5db36ddf855f")
;;; Generated autoloads from cl-seq.el
(autoload (quote reduce) "cl-seq" "\

View file

@ -628,7 +628,7 @@ If ALIST is non-nil, the new pairs are prepended to it."
(fmakunbound 'dolist)
(fmakunbound 'dotimes)
(fmakunbound 'declare)
(load "cl-loaddefs")
(load "cl-loaddefs" nil 'quiet)
;; This goes here so that cl-macs can find it if it loads right now.
(provide 'cl-19) ; usage: (require 'cl-19 "cl")

View file

@ -77,7 +77,7 @@ When this is `function', only ask when called non-interactively."
;; when modifying this, also modify the comment generated by autoinsert.el
(defconst copyright-current-gpl-version "2"
(defconst copyright-current-gpl-version "3"
"String representing the current version of the GPL or nil.")
(defvar copyright-update t)

View file

@ -152,6 +152,21 @@ A menu item can be a list with the same format as MENU. This is a submenu."
,(if symbol `(defvar ,symbol nil ,doc))
(easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu)))
(defun easy-menu-binding (menu &optional item-name)
"Return a binding suitable to pass to `define-key'.
This is expected to be bound to a mouse event."
;; Under Emacs this is almost trivial, whereas under XEmacs this may
;; involve defining a function that calls popup-menu.
(let ((props (if (symbolp menu)
(prog1 (get menu 'menu-prop)
(setq menu (symbol-function menu))))))
(cons 'menu-item
(cons (or item-name
(if (keymapp menu)
(keymap-prompt menu))
"")
(cons menu props)))))
;;;###autoload
(defun easy-menu-do-define (symbol maps doc menu)
;; We can't do anything that might differ between Emacs dialects in
@ -173,15 +188,10 @@ A menu item can be a list with the same format as MENU. This is a submenu."
'identity)
(symbol-function ,symbol)))
,symbol)))))
(mapcar (lambda (map)
(define-key map (vector 'menu-bar (easy-menu-intern (car menu)))
(cons 'menu-item
(cons (car menu)
(if (not (symbolp keymap))
(list keymap)
(cons (symbol-function keymap)
(get keymap 'menu-prop)))))))
(if (keymapp maps) (list maps) maps))))
(dolist (map (if (keymapp maps) (list maps) maps))
(define-key map
(vector 'menu-bar (easy-menu-intern (car menu)))
(easy-menu-binding keymap (car menu))))))
(defun easy-menu-filter-return (menu &optional name)
"Convert MENU to the right thing to return from a menu filter.
@ -249,10 +259,6 @@ possibly preceded by keyword pairs as described in `easy-menu-define'."
(defvar easy-menu-button-prefix
'((radio . :radio) (toggle . :toggle)))
(defun easy-menu-do-add-item (menu item &optional before)
(setq item (easy-menu-convert-item item))
(easy-menu-define-key menu (easy-menu-intern (car item)) (cdr item) before))
(defvar easy-menu-converted-items-table (make-hash-table :test 'equal))
(defun easy-menu-convert-item (item)
@ -269,7 +275,7 @@ would always fail because the key is `equal' but not `eq'."
(defun easy-menu-convert-item-1 (item)
"Parse an item description and convert it to a menu keymap element.
ITEM defines an item as in `easy-menu-define'."
(let (name command label prop remove help)
(let (name command label prop remove)
(cond
((stringp item) ; An item or separator.
(setq label item))
@ -536,7 +542,8 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
(setq item (symbol-value item))))
;; Item is a keymap, find the prompt string and use as item name.
(setq item (cons (keymap-prompt item) item)))
(easy-menu-do-add-item map item before)))
(setq item (easy-menu-convert-item item))
(easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before)))
(defun easy-menu-item-present-p (map path name)
"In submenu of MAP with path PATH, return non-nil iff item NAME is present.
@ -615,7 +622,8 @@ In some cases we use that to select between the local and global maps."
(catch 'found
(if (and map (symbolp map) (not (keymapp map)))
(setq map (symbol-value map)))
(let ((maps (if map (list map) (current-active-maps))))
(let ((maps (if map (if (keymapp map) (list map) map)
(current-active-maps))))
;; Look for PATH in each map.
(unless map (push 'menu-bar path))
(dolist (name path)

View file

@ -124,8 +124,8 @@ directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.")
(defconst eldoc-last-data (make-vector 3 nil)
"Bookkeeping; elements are as follows:
0 - contains the last symbol read from the buffer.
1 - contains the string last displayed in the echo area for that
symbol, so it can be printed again if necessary without reconsing.
1 - contains the string last displayed in the echo area for variables,
or argument string for functions.
2 - 'function if function args, 'variable if variable documentation.")
(defvar eldoc-last-message nil)
@ -249,12 +249,16 @@ Emacs Lisp mode) that support Eldoc.")
(let* ((current-symbol (eldoc-current-symbol))
(current-fnsym (eldoc-fnsym-in-current-sexp))
(doc (cond
((eq current-symbol current-fnsym)
(or (eldoc-get-fnsym-args-string current-fnsym)
((null current-fnsym)
nil)
((eq current-symbol (car current-fnsym))
(or (apply 'eldoc-get-fnsym-args-string
current-fnsym)
(eldoc-get-var-docstring current-symbol)))
(t
(or (eldoc-get-var-docstring current-symbol)
(eldoc-get-fnsym-args-string current-fnsym))))))
(apply 'eldoc-get-fnsym-args-string
current-fnsym))))))
(eldoc-message doc))))
;; This is run from post-command-hook or some idle timer thing,
;; so we need to be careful that errors aren't ignored.
@ -263,24 +267,62 @@ Emacs Lisp mode) that support Eldoc.")
;; Return a string containing the function parameter list, or 1-line
;; docstring if function is a subr and no arglist is obtainable from the
;; docstring or elsewhere.
(defun eldoc-get-fnsym-args-string (sym)
(defun eldoc-get-fnsym-args-string (sym argument-index)
(let ((args nil)
(doc nil))
(cond ((not (and sym (symbolp sym) (fboundp sym))))
((and (eq sym (aref eldoc-last-data 0))
(eq 'function (aref eldoc-last-data 2)))
(setq doc (aref eldoc-last-data 1)))
(setq args (aref eldoc-last-data 1)))
((setq doc (help-split-fundoc (documentation sym t) sym))
(setq args (car doc))
(string-match "\\`[^ )]* ?" args)
(setq args (concat "(" (substring args (match-end 0)))))
(setq args (concat "(" (substring args (match-end 0))))
(eldoc-last-data-store sym args 'function))
(t
(setq args (eldoc-function-argstring sym))))
(cond (args
(setq doc (eldoc-docstring-format-sym-doc sym args))
(eldoc-last-data-store sym doc 'function)))
(when args
(setq doc (eldoc-highlight-function-argument sym args argument-index)))
doc))
;; Highlight argument INDEX in ARGS list for SYM.
(defun eldoc-highlight-function-argument (sym args index)
(let ((start nil)
(end 0)
(argument-face 'bold))
;; Find the current argument in the argument string. We need to
;; handle `&rest' and informal `...' properly.
;;
;; FIXME: What to do with optional arguments, like in
;; (defun NAME ARGLIST [DOCSTRING] BODY...) case?
;; The problem is there is no robust way to determine if
;; the current argument is indeed a docstring.
(while (>= index 1)
(if (string-match "[^ ()]+" args end)
(progn
(setq start (match-beginning 0)
end (match-end 0))
(let ((argument (match-string 0 args)))
(cond ((string= argument "&rest")
;; All the rest arguments are the same.
(setq index 1))
((string= argument "&optional"))
((string-match "\\.\\.\\.$" argument)
(setq index 0))
(t
(setq index (1- index))))))
(setq end (length args)
start (1- end)
argument-face 'font-lock-warning-face
index 0)))
(let ((doc args))
(when start
(setq doc (copy-sequence args))
(add-text-properties start end (list 'face argument-face) doc))
(setq doc (eldoc-docstring-format-sym-doc
sym doc 'font-lock-function-name-face))
doc)))
;; Return a string containing a brief (one-line) documentation string for
;; the variable.
(defun eldoc-get-var-docstring (sym)
@ -292,7 +334,8 @@ Emacs Lisp mode) that support Eldoc.")
(let ((doc (documentation-property sym 'variable-documentation t)))
(cond (doc
(setq doc (eldoc-docstring-format-sym-doc
sym (eldoc-docstring-first-line doc)))
sym (eldoc-docstring-first-line doc)
'font-lock-variable-name-face))
(eldoc-last-data-store sym doc 'variable)))
doc)))))
@ -316,7 +359,7 @@ Emacs Lisp mode) that support Eldoc.")
;; If the entire line cannot fit in the echo area, the symbol name may be
;; truncated or eliminated entirely from the output to make room for the
;; description.
(defun eldoc-docstring-format-sym-doc (sym doc)
(defun eldoc-docstring-format-sym-doc (sym doc face)
(save-match-data
(let* ((name (symbol-name sym))
(ea-multi eldoc-echo-area-use-multiline-p)
@ -328,7 +371,7 @@ Emacs Lisp mode) that support Eldoc.")
(cond ((or (<= strip 0)
(eq ea-multi t)
(and ea-multi (> (length doc) ea-width)))
(format "%s: %s" sym doc))
(format "%s: %s" (propertize name 'face face) doc))
((> (length doc) ea-width)
(substring (format "%s" doc) 0 ea-width))
((>= strip (length name))
@ -338,27 +381,44 @@ Emacs Lisp mode) that support Eldoc.")
;; than the beginning, since the former is more likely
;; to be unique given package namespace conventions.
(setq name (substring name strip))
(format "%s: %s" name doc))))))
(format "%s: %s" (propertize name 'face face) doc))))))
;; Return a list of current function name and argument index.
(defun eldoc-fnsym-in-current-sexp ()
(let ((p (point)))
(eldoc-beginning-of-sexp)
(prog1
;; Don't do anything if current word is inside a string.
(if (= (or (char-after (1- (point))) 0) ?\")
nil
(eldoc-current-symbol))
(goto-char p))))
(save-excursion
(let ((argument-index (1- (eldoc-beginning-of-sexp))))
;; If we are at the beginning of function name, this will be -1.
(when (< argument-index 0)
(setq argument-index 0))
;; Don't do anything if current word is inside a string.
(if (= (or (char-after (1- (point))) 0) ?\")
nil
(list (eldoc-current-symbol) argument-index)))))
;; Move to the beginnig of current sexp. Return the number of nested
;; sexp the point was over or after.
(defun eldoc-beginning-of-sexp ()
(let ((parse-sexp-ignore-comments t))
(let ((parse-sexp-ignore-comments t)
(num-skipped-sexps 0))
(condition-case err
(while (progn
(forward-sexp -1)
(or (= (char-before) ?\")
(> (point) (point-min)))))
(error nil))))
(progn
;; First account for the case the point is directly over a
;; beginning of a nested sexp.
(condition-case err
(let ((p (point)))
(forward-sexp -1)
(forward-sexp 1)
(when (< (point) p)
(setq num-skipped-sexps 1)))
(error))
(while
(let ((p (point)))
(forward-sexp -1)
(when (< (point) p)
(setq num-skipped-sexps (1+ num-skipped-sexps))))))
(error))
num-skipped-sexps))
;; returns nil unless current word is an interned symbol.
(defun eldoc-current-symbol ()

View file

@ -730,7 +730,9 @@ If the current defun is actually a call to `defvar' or `defcustom',
evaluating it this way resets the variable using its initial value
expression even if the variable already has some other value.
\(Normally `defvar' and `defcustom' do not alter the value if there
already is one.)
already is one.) In an analogous way, evaluating a `defface'
overrides any customizations of the face, so that it becomes
defined exactly as the `defface' expression says.
If `eval-expression-debug-on-error' is non-nil, which is the default,
this command arranges for all errors to enter the debugger.

View file

@ -162,7 +162,7 @@ The truename of a file is found by chasing all links
both at the file level and at the levels of the containing directories."
:type 'boolean
:group 'find-file)
(put 'find-file-visit-truename 'safe-local-variable 'boolean)
(put 'find-file-visit-truename 'safe-local-variable 'booleanp)
(defcustom revert-without-query nil
"Specify which files should be reverted without query.
@ -727,17 +727,23 @@ This is an interface to the function `load'."
(cons load-path (get-load-suffixes)))))
(load library))
(defun file-remote-p (file)
(defun file-remote-p (file &optional connected)
"Test whether FILE specifies a location on a remote system.
Return an identification of the system if the location is indeed
remote. The identification of the system may comprise a method
to access the system and its hostname, amongst other things.
For example, the filename \"/user@host:/foo\" specifies a location
on the system \"/user@host:\"."
on the system \"/user@host:\".
If CONNECTED is non-nil, the function returns an identification only
if FILE is located on a remote system, and a connection is established
to that remote system.
`file-remote-p' will never open a connection on its own."
(let ((handler (find-file-name-handler file 'file-remote-p)))
(if handler
(funcall handler 'file-remote-p file)
(funcall handler 'file-remote-p file connected)
nil)))
(defun file-local-copy (file)

View file

@ -336,123 +336,45 @@ After that, changing the prefix key requires manipulating keymaps."
;; the look and feel of Follow mode.)
(define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer)
;;
;; The menu.
;;
(if (not (featurep 'xemacs))
;;
;; Emacs
;;
(let ((menumap (funcall (symbol-function 'make-sparse-keymap)
"Follow"))
(count 0)
id)
(mapcar
(function
(lambda (item)
(setq id
(or (cdr item)
(progn
(setq count (+ count 1))
(intern (format "separator-%d" count)))))
(define-key menumap (vector id) item)
(or (eq id 'follow-mode)
(put id 'menu-enable 'follow-mode))))
;; In reverse order:
'(("Toggle Follow mode" . follow-mode)
("--")
("Recenter" . follow-recenter)
("--")
("Previous Window" . follow-previous-window)
("Next Windows" . follow-next-window)
("Last Window" . follow-last-window)
("First Window" . follow-first-window)
("--")
("Switch To Buffer (all windows)"
. follow-switch-to-buffer-all)
("Switch To Buffer" . follow-switch-to-buffer)
("--")
("Delete Other Windows and Split"
. follow-delete-other-windows-and-split)
("--")
("Scroll Down" . follow-scroll-down)
("Scroll Up" . follow-scroll-up)))
;; If there is a `tools' menu, we use it. However, we can't add a
;; minor-mode specific item to it (it's broken), so we make the
;; contents ghosted when not in use, and add ourselves to the
;; global map. If no `tools' menu is present, just make a
;; top-level menu visible when the mode is activated.
(let ((tools-map (lookup-key (current-global-map) [menu-bar tools]))
(last nil))
(if (sequencep tools-map)
(progn
;; Find the last entry in the menu and store it in `last'.
(mapcar (function
(lambda (x)
(setq last (or (cdr-safe
(cdr-safe
(cdr-safe x)))
last))))
tools-map)
(if last
(progn
(funcall (symbol-function 'define-key-after)
tools-map [separator-follow] '("--") last)
(funcall (symbol-function 'define-key-after)
tools-map [follow] (cons "Follow" menumap)
'separator-follow))
;; Didn't find the last item, Adding to the top of
;; tools. (This will probably never happend...)
(define-key (current-global-map) [menu-bar tools follow]
(cons "Follow" menumap))))
;; No tools menu, add "Follow" to the menubar.
(define-key mainmap [menu-bar follow]
(cons "Follow" menumap)))))
;;
;; XEmacs.
;;
;; place the menu in the `Tools' menu.
(let ((menu '("Follow"
:filter follow-menu-filter
["Scroll Up" follow-scroll-up t]
["Scroll Down" follow-scroll-down t]
["Delete Other Windows and Split"
follow-delete-other-windows-and-split t]
["Switch To Buffer" follow-switch-to-buffer t]
["Switch To Buffer (all windows)"
follow-switch-to-buffer-all t]
["First Window" follow-first-window t]
["Last Window" follow-last-window t]
["Next Windows" follow-next-window t]
["Previous Window" follow-previous-window t]
["Recenter" follow-recenter t]
["Deactivate" follow-mode t])))
;; Why not just `(set-buffer-menubar current-menubar)'? The
;; question is a very good question. The reason is that under
;; Emacs, neither `set-buffer-menubar' nor
;; `current-menubar' is defined, hence the byte-compiler will
;; warn.
(funcall (symbol-function 'set-buffer-menubar)
(symbol-value 'current-menubar))
(funcall (symbol-function 'add-submenu) '("Tools") menu))
;; When the mode is not activated, only one item is visible:
;; "Activate".
(defun follow-menu-filter (menu)
(if follow-mode
menu
'(["Activate " follow-mode t]))))
mainmap)
"Minor mode keymap for Follow mode.")
;; When the mode is not activated, only one item is visible to activate
;; the mode.
(defun follow-menu-filter (menu)
(if (bound-and-true-p 'follow-mode)
menu
'(["Follow mode " follow-mode
:style toggle :selected follow-mode])))
;; If there is a `tools' menu, we use it. However, we can't add a
;; minor-mode specific item to it (it's broken), so we make the
;; contents ghosted when not in use, and add ourselves to the
;; global map.
(easy-menu-add-item nil '("Tools")
'("Follow"
;; The Emacs code used to just grey out operations when follow-mode was
;; not enabled, whereas the XEmacs code used to remove it altogether.
;; Not sure which is preferable, but clearly the preference should not
;; depend on the flavor.
:filter follow-menu-filter
["Scroll Up" follow-scroll-up follow-mode]
["Scroll Down" follow-scroll-down follow-mode]
"--"
["Delete Other Windows and Split" follow-delete-other-windows-and-split follow-mode]
"--"
["Switch To Buffer" follow-switch-to-buffer follow-mode]
["Switch To Buffer (all windows)" follow-switch-to-buffer-all follow-mode]
"--"
["First Window" follow-first-window follow-mode]
["Last Window" follow-last-window follow-mode]
["Next Window" follow-next-window follow-mode]
["Previous Window" follow-previous-window follow-mode]
"--"
["Recenter" follow-recenter follow-mode]
"--"
["Follow mode" follow-mode :style toggle :selected follow-mode]))
;;}}}
(defcustom follow-mode-line-text " Follow"
@ -553,14 +475,12 @@ Used by `follow-window-size-change'.")
;;;###autoload
(defun turn-on-follow-mode ()
"Turn on Follow mode. Please see the function `follow-mode'."
(interactive)
(follow-mode 1))
;;;###autoload
(defun turn-off-follow-mode ()
"Turn off Follow mode. Please see the function `follow-mode'."
(interactive)
(follow-mode -1))
(put 'follow-mode 'permanent-local t)
@ -2084,8 +2004,8 @@ report this using the `report-emacs-bug' function."
(defun follow-window-size-change (frame)
"Redraw all windows in FRAME, when in Follow mode."
;; Below, we call `post-command-hook'. This makes sure that we
;; doesn't start a mutally recursive endless loop.
;; Below, we call `post-command-hook'. This makes sure that we
;; don't start a mutually recursive endless loop.
(if follow-inside-post-command-hook
nil
(let ((buffers '())
@ -2109,12 +2029,12 @@ report this using the `report-emacs-bug' function."
(setq windows (follow-all-followers win))
(if (memq orig-window windows)
(progn
;; Make sure we're redrawing around the
;; selected window.
;;
;; We must be really careful not to do this
;; when we are (indirectly) called by
;; `post-command-hook'.
;; Make sure we're redrawing around the
;; selected window.
;;
;; We must be really careful not to do this
;; when we are (indirectly) called by
;; `post-command-hook'.
(select-window orig-window)
(follow-post-command-hook)
(setq orig-window (selected-window)))

View file

@ -1,3 +1,42 @@
2007-07-14 David Kastrup <dak@gnu.org>
* gnus-art.el (gnus-mime-delete-part): Don't go through article-edit
finishing actions if we did not edit the article.
2007-07-13 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-srvr.el (gnus-server-agent-face, gnus-server-opened-face)
(gnus-server-closed-face, gnus-server-denied-face)
(gnus-server-offline-face): Remove variable.
(gnus-server-font-lock-keywords): Use faces that are not aliases.
* mm-util.el (mm-decode-coding-string, mm-encode-coding-string)
(mm-decode-coding-region, mm-encode-coding-region): Don't modify string
if the coding-system argument is nil for XEmacs.
* nnrss.el (nnrss-compatible-encoding-alist): Inherit the value of
mm-charset-override-alist.
* rfc2047.el: Don't require base64; require rfc2045 for the function
rfc2045-encode-string.
(rfc2047-encode-parameter): Use rfc2045-encode-string to quote or not
to quote the parameter value.
2007-07-04 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-sum.el (gnus-summary-catchup): Don't recognize cached articles
as unfetched articles.
2007-07-02 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-start.el (gnus-level-unsubscribed): Improve doc string.
2007-06-26 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (gnus-article-summary-command-nosave)
(gnus-article-read-summary-keys): Don't set the 3rd arg of
pop-to-buffer for XEmacs.
2007-06-14 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-agent.el (gnus-agent-fetch-headers)

View file

@ -4408,11 +4408,11 @@ Deleting parts may malfunction or destroy the article; continue? ")
(gnus-summary-edit-article-done
,(or (mail-header-references gnus-current-headers) "")
,(gnus-group-read-only-p)
,gnus-summary-buffer no-highlight)))))
;; Not in `gnus-mime-save-part-and-strip':
(gnus-article-edit-done)
(gnus-summary-expand-window)
(gnus-summary-show-article))
,gnus-summary-buffer no-highlight))))
;; Not in `gnus-mime-save-part-and-strip':
(gnus-article-edit-done)
(gnus-summary-expand-window)
(gnus-summary-show-article)))
(defun gnus-mime-save-part ()
"Save the MIME part under point."
@ -5607,7 +5607,7 @@ not have a face in `gnus-article-boring-faces'."
"Execute the last keystroke in the summary buffer."
(interactive)
(let (func)
(pop-to-buffer gnus-article-current-summary nil 'norecord)
(pop-to-buffer gnus-article-current-summary nil (not (featurep 'xemacs)))
(setq func (lookup-key (current-local-map) (this-command-keys)))
(call-interactively func)))
@ -5646,7 +5646,8 @@ not have a face in `gnus-article-boring-faces'."
(member keys nosave-in-article))
(let (func)
(save-window-excursion
(pop-to-buffer gnus-article-current-summary nil 'norecord)
(pop-to-buffer gnus-article-current-summary
nil (not (featurep 'xemacs)))
;; We disable the pick minor mode commands.
(let (gnus-pick-mode)
(setq func (lookup-key (current-local-map) keys))))
@ -5658,14 +5659,16 @@ not have a face in `gnus-article-boring-faces'."
(call-interactively func)
(setq new-sum-point (point)))
(when (member keys nosave-but-article)
(pop-to-buffer gnus-article-buffer nil 'norecord)))
(pop-to-buffer gnus-article-buffer
nil (not (featurep 'xemacs)))))
;; These commands should restore window configuration.
(let ((obuf (current-buffer))
(owin (current-window-configuration))
(opoint (point))
win func in-buffer selected new-sum-start new-sum-hscroll)
(cond (not-restore-window
(pop-to-buffer gnus-article-current-summary nil 'norecord))
(pop-to-buffer gnus-article-current-summary
nil (not (featurep 'xemacs))))
((setq win (get-buffer-window gnus-article-current-summary))
(select-window win))
(t

View file

@ -214,43 +214,12 @@ If nil, a faster, but more primitive, buffer is used instead."
;; backward-compatibility alias
(put 'gnus-server-offline-face 'face-alias 'gnus-server-offline)
(defcustom gnus-server-agent-face 'gnus-server-agent
"Face name to use on AGENTIZED servers."
:version "22.1"
:group 'gnus-server-visual
:type 'face)
(defcustom gnus-server-opened-face 'gnus-server-opened
"Face name to use on OPENED servers."
:version "22.1"
:group 'gnus-server-visual
:type 'face)
(defcustom gnus-server-closed-face 'gnus-server-closed
"Face name to use on CLOSED servers."
:version "22.1"
:group 'gnus-server-visual
:type 'face)
(defcustom gnus-server-denied-face 'gnus-server-denied
"Face name to use on DENIED servers."
:version "22.1"
:group 'gnus-server-visual
:type 'face)
(defcustom gnus-server-offline-face 'gnus-server-offline
"Face name to use on OFFLINE servers."
:version "22.1"
:group 'gnus-server-visual
:type 'face)
(defvar gnus-server-font-lock-keywords
(list
'("(\\(agent\\))" 1 gnus-server-agent-face)
'("(\\(opened\\))" 1 gnus-server-opened-face)
'("(\\(closed\\))" 1 gnus-server-closed-face)
'("(\\(offline\\))" 1 gnus-server-offline-face)
'("(\\(denied\\))" 1 gnus-server-denied-face)))
'(("(\\(agent\\))" 1 gnus-server-agent)
("(\\(opened\\))" 1 gnus-server-opened)
("(\\(closed\\))" 1 gnus-server-closed)
("(\\(offline\\))" 1 gnus-server-offline)
("(\\(denied\\))" 1 gnus-server-denied)))
(defun gnus-server-mode ()
"Major mode for listing and editing servers.

View file

@ -178,8 +178,13 @@ properly with all servers."
(defconst gnus-level-unsubscribed 7
"Groups with levels less than or equal to this variable are unsubscribed.
Groups with levels less than `gnus-level-subscribed', which should be
less than this variable, are subscribed.")
Groups with levels less than `gnus-level-subscribed', which
should be less than this variable, are subscribed. Groups with
levels from `gnus-level-subscribed' (exclusive) upto this
variable (inclusive) are unsubscribed. See also
`gnus-level-zombie', `gnus-level-killed' and the Info node `Group
Levels' for details.")
(defconst gnus-level-zombie 8
"Groups with this level are zombie groups.")

View file

@ -10514,7 +10514,8 @@ The number of articles marked as read is returned."
(gnus-sorted-nunion
(gnus-sorted-intersection gnus-newsgroup-unreads
gnus-newsgroup-downloadable)
gnus-newsgroup-unfetched)))
(gnus-sorted-difference gnus-newsgroup-unfetched
gnus-newsgroup-cached))))
;; We actually mark all articles as canceled, which we
;; have to do when using auto-expiry or adaptive scoring.
(gnus-summary-show-all-threads)

View file

@ -36,11 +36,7 @@
(if (fboundp (car elem))
(defalias nfunc (car elem))
(defalias nfunc (cdr elem)))))
'((decode-coding-string . (lambda (s a) s))
(encode-coding-string . (lambda (s a) s))
(encode-coding-region . ignore)
(coding-system-list . ignore)
(decode-coding-region . ignore)
'((coding-system-list . ignore)
(char-int . identity)
(coding-system-equal . equal)
(annotationp . ignore)
@ -96,6 +92,34 @@
(insert-byte . insert-char)
(multibyte-char-to-unibyte . identity))))
(eval-and-compile
(if (featurep 'xemacs)
(if (featurep 'file-coding)
;; Don't modify string if CODING-SYSTEM is nil.
(progn
(defun mm-decode-coding-string (str coding-system)
(if coding-system
(decode-coding-string str coding-system)
str))
(defun mm-encode-coding-string (str coding-system)
(if coding-system
(encode-coding-string str coding-system)
str))
(defun mm-decode-coding-region (start end coding-system)
(if coding-system
(decode-coding-region start end coding-system)))
(defun mm-encode-coding-region (start end coding-system)
(if coding-system
(encode-coding-region start end coding-system))))
(defun mm-decode-coding-string (str coding-system) str)
(defun mm-encode-coding-string (str coding-system) str)
(defalias 'mm-decode-coding-region 'ignore)
(defalias 'mm-encode-coding-region 'ignore))
(defalias 'mm-decode-coding-string 'decode-coding-string)
(defalias 'mm-encode-coding-string 'encode-coding-string)
(defalias 'mm-decode-coding-region 'decode-coding-region)
(defalias 'mm-encode-coding-region 'encode-coding-region)))
(eval-and-compile
(cond
((fboundp 'replace-in-string)

View file

@ -85,7 +85,12 @@ ARTICLE is the article number of the current headline.")
(defvar nnrss-file-coding-system mm-universal-coding-system
"Coding system used when reading and writing files.")
(defvar nnrss-compatible-encoding-alist '((iso-8859-1 . windows-1252))
(defvar nnrss-compatible-encoding-alist
(delq nil (mapcar (lambda (elem)
(if (and (mm-coding-system-p (car elem))
(mm-coding-system-p (cdr elem)))
elem))
mm-charset-override-alist))
"Alist of encodings and those supersets.
The cdr of each element is used to decode data if it is available when
the car is what the data specify as the encoding. Or, the car is used

View file

@ -55,7 +55,7 @@ Value is what BODY returns."
(require 'ietf-drums)
;; Fixme: Avoid this (used for mail-parse-charset) mm dependence on gnus.
(require 'mail-prsvr)
(require 'base64)
(require 'rfc2045) ;; rfc2045-encode-string
(autoload 'mm-body-7-or-8 "mm-bodies")
(eval-and-compile
@ -834,12 +834,9 @@ it, put the following line in your ~/.gnus.el file:
\(defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter)
"
(let* ((rfc2047-encoding-type 'mime)
(rfc2047-encode-max-chars nil)
(string (rfc2047-encode-string value)))
(if (string-match (concat "[" ietf-drums-tspecials "]") string)
(format "%s=%S" param string)
(concat param "=" string))))
(let ((rfc2047-encoding-type 'mime)
(rfc2047-encode-max-chars nil))
(rfc2045-encode-string param (rfc2047-encode-string value))))
;;;
;;; Functions for decoding RFC2047 messages

View file

@ -1065,6 +1065,7 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst
;; Reinvoke the pending search.
(isearch-search)
(isearch-push-state)
(isearch-update)
(if isearch-nonincremental
(progn

View file

@ -411,7 +411,7 @@ install:
- $(DEL) "$(INSTALL_DIR)/same-dir.tst"
echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
#ifdef COPY_LISP_SOURCE
$(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
$(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF)
#else
# $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
# $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
@ -428,6 +428,19 @@ install:
- $(DEL) ../same-dir.tst
- $(DEL) "$(INSTALL_DIR)/same-dir.tst"
# Need to copy *.el files first, to avoid "source file is newer" annoyance
# since cp does not preserve time stamps
install-lisp-SH:
cp -f *.el "$(INSTALL_DIR)/lisp"
for dir in $(WINS); do mkdir "$(INSTALL_DIR)/lisp/$$dir" && cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done
for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done
install-lisp-CMD:
cp -f *.el "$(INSTALL_DIR)/lisp"
for %%f in ($(WINS)) do mkdir "$(INSTALL_DIR)/lisp/%%f"
for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f"
for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f"
#
# Maintenance
#

View file

@ -1161,6 +1161,7 @@ mail status in mode line"))
'("--"))
(defvar vc-menu-map (make-sparse-keymap "Version Control"))
(defalias 'vc-menu-map vc-menu-map)
(define-key menu-bar-tools-menu [pcl-cvs]
'(menu-item "PCL-CVS" cvs-global-menu))
(define-key menu-bar-tools-menu [vc]

View file

@ -1,3 +1,8 @@
2007-07-11 Bill Wohler <wohler@newt.com>
* mh-compat.el (mh-display-color-cells): Fix on XEmacs 21.5b28.
Thanks to Henrique Martins for the help (closes SF #1749774).
2007-06-06 Juanma Barranquero <lekktu@gmail.com>
* mh-mime.el (mh-mh-directive-present-p):

View file

@ -77,13 +77,17 @@ introduced in Emacs 22."
'cancel-timer
'delete-itimer))
(defun-mh mh-display-color-cells display-color-cells (&optional display)
(defun mh-display-color-cells (&optional display)
"Return the number of color cells supported by DISPLAY.
This function is used by XEmacs to return 2 when
`device-color-cells' returns nil. This happens when compiling or
This function is used by XEmacs to return 2 when `device-color-cells'
or `display-color-cells' returns nil. This happens when compiling or
running on a tty and causes errors since `display-color-cells' is
expected to return an integer."
(or (device-color-cells display) 2))
(cond ((fboundp 'display-color-cells) ; GNU Emacs, XEmacs 21.5b28
(or (display-color-cells display) 2))
((fboundp 'device-color-cells) ; XEmacs 21.4
(or (device-color-cells display) 2))
(t 2)))
(defmacro mh-display-completion-list (completions &optional common-substring)
"Display the list of COMPLETIONS.

View file

@ -4132,8 +4132,15 @@ directory, so that Emacs will know its current contents."
(format "Getting %s" fn1))
tmp1))))
(defun ange-ftp-file-remote-p (file)
(ange-ftp-replace-name-component file ""))
(defun ange-ftp-file-remote-p (file &optional connected)
(and (or (not connected)
(let* ((parsed (ange-ftp-ftp-name file))
(host (nth 0 parsed))
(user (nth 1 parsed))
(proc (get-process (ange-ftp-ftp-process-buffer host user))))
(and proc (processp proc)
(memq (process-status proc) '(run open)))))
(ange-ftp-replace-name-component file "")))
(defun ange-ftp-load (file &optional noerror nomessage nosuffix)
(if (ange-ftp-ftp-name file)
@ -4360,7 +4367,10 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
;; This returns nil for any file name as argument.
(put 'vc-registered 'ange-ftp 'null)
;; We can handle process-file in a restricted way (just for chown).
;; Nothing possible for start-file-process.
(put 'process-file 'ange-ftp 'ange-ftp-process-file)
(put 'start-file-process 'ange-ftp 'ignore)
(put 'shell-command 'ange-ftp 'ange-ftp-shell-command)
;;; Define ways of getting at unmodified Emacs primitives,

View file

@ -188,8 +188,7 @@ See \\[compile]."
(when (featurep 'tramp)
(set (make-local-variable 'comint-file-name-prefix)
(funcall (symbol-function 'tramp-make-tramp-file-name)
nil ;; multi-method. To be removed with Tramp 2.1.
nil
nil ;; method.
remote-compile-user
remote-compile-host
""))))))

317
lisp/net/tramp-cache.el Normal file
View file

@ -0,0 +1,317 @@
;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*-
;;; tramp-cache.el --- file information caching for Tramp
;; Copyright (C) 2000, 2005, 2006, 2007 by Free Software Foundation, Inc.
;; Author: Daniel Pittman <daniel@inanna.danann.net>
;; Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, see
;; <http://www.gnu.org/licenses/>.
;;; Commentary:
;; An implementation of information caching for remote files.
;; Each connection, identified by a vector [method user host
;; localname] or by a process, has a unique cache. We distinguish 3
;; kind of caches, depending on the key:
;;
;; - localname is NIL. This are reusable properties. Examples:
;; "remote-shell" identifies the POSIX shell to be called on the
;; remote host, or "perl" is the command to be called on the remote
;; host, when starting a Perl script. These properties are saved in
;; the file `tramp-persistency-file-name'.
;;
;; - localname is a string. This are temporary properties, which are
;; related to the file localname is referring to. Examples:
;; "file-exists-p" is t or nile, depending on the file existence, or
;; "file-attributes" caches the result of the function
;; `file-attributes'.
;;
;; - The key is a process. This are temporary properties related to
;; an open connection. Examples: "scripts" keeps shell script
;; definitions already sent to the remote shell, "last-cmd-time" is
;; the time stamp a command has been sent to the remote process.
;;; Code:
;; Pacify byte-compiler.
(eval-when-compile
(require 'cl)
(autoload 'tramp-message "tramp")
(autoload 'tramp-tramp-file-p "tramp")
;; We cannot autoload macro `with-parsed-tramp-file-name', it
;; results in problems of byte-compiled code.
(autoload 'tramp-dissect-file-name "tramp")
(autoload 'tramp-file-name-method "tramp")
(autoload 'tramp-file-name-user "tramp")
(autoload 'tramp-file-name-host "tramp")
(autoload 'tramp-file-name-localname "tramp")
(autoload 'time-stamp-string "time-stamp"))
;;; -- Cache --
(defvar tramp-cache-data (make-hash-table :test 'equal)
"Hash table for remote files properties.")
(defcustom tramp-persistency-file-name
(cond
;; GNU Emacs.
((and (boundp 'user-emacs-directory)
(stringp (symbol-value 'user-emacs-directory))
(file-directory-p (symbol-value 'user-emacs-directory)))
(expand-file-name "tramp" (symbol-value 'user-emacs-directory)))
((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/"))
"~/.emacs.d/tramp")
;; XEmacs.
((and (boundp 'user-init-directory)
(stringp (symbol-value 'user-init-directory))
(file-directory-p (symbol-value 'user-init-directory)))
(expand-file-name "tramp" (symbol-value 'user-init-directory)))
((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
"~/.xemacs/tramp")
;; For users without `~/.emacs.d/' or `~/.xemacs/'.
(t "~/.tramp"))
"File which keeps connection history for Tramp connections."
:group 'tramp
:type 'file)
(defun tramp-get-file-property (vec file property default)
"Get the PROPERTY of FILE from the cache context of VEC.
Returns DEFAULT if not set."
;; Unify localname.
(setq vec (copy-sequence vec))
(aset vec 3 (directory-file-name file))
(let* ((hash (or (gethash vec tramp-cache-data)
(puthash vec (make-hash-table :test 'equal)
tramp-cache-data)))
(value (if (hash-table-p hash)
(gethash property hash default)
default)))
(tramp-message vec 8 "%s %s %s" file property value)
value))
(defun tramp-set-file-property (vec file property value)
"Set the PROPERTY of FILE to VALUE, in the cache context of VEC.
Returns VALUE."
;; Unify localname.
(setq vec (copy-sequence vec))
(aset vec 3 (directory-file-name file))
(let ((hash (or (gethash vec tramp-cache-data)
(puthash vec (make-hash-table :test 'equal)
tramp-cache-data))))
(puthash property value hash)
(tramp-message vec 8 "%s %s %s" file property value)
value))
(defun tramp-flush-file-property (vec file)
"Remove all properties of FILE in the cache context of VEC."
;; Unify localname.
(setq vec (copy-sequence vec))
(aset vec 3 (directory-file-name file))
(tramp-message vec 8 "%s" file)
(remhash vec tramp-cache-data))
(defun tramp-flush-directory-property (vec directory)
"Remove all properties of DIRECTORY in the cache context of VEC.
Remove also properties of all files in subdirectories."
(let ((directory (directory-file-name directory)))
(tramp-message vec 8 "%s" directory)
(maphash
'(lambda (key value)
(when (and (stringp key)
(string-match directory (tramp-file-name-localname key)))
(remhash key tramp-cache-data)))
tramp-cache-data)))
(defun tramp-cache-print (table)
"Prints hash table TABLE."
(when (hash-table-p table)
(let (result tmp)
(maphash
'(lambda (key value)
(setq tmp (format
"(%s %s)"
(if (processp key)
(prin1-to-string (prin1-to-string key))
(prin1-to-string key))
(if (hash-table-p value)
(tramp-cache-print value)
(if (bufferp value)
(prin1-to-string (prin1-to-string value))
(prin1-to-string value))))
result (if result (concat result " " tmp) tmp)))
table)
result)))
;; Reverting or killing a buffer should also flush file properties.
;; They could have been changed outside Tramp.
(defun tramp-flush-file-function ()
"Flush all Tramp cache properties from buffer-file-name."
(let ((bfn (buffer-file-name)))
(when (and (stringp bfn) (tramp-tramp-file-p bfn))
(let* ((v (tramp-dissect-file-name bfn))
(localname (tramp-file-name-localname v)))
(tramp-flush-file-property v localname)))))
(add-hook 'before-revert-hook 'tramp-flush-file-function)
(add-hook 'kill-buffer-hook 'tramp-flush-file-function)
(add-hook 'tramp-cache-unload-hook
'(lambda ()
(remove-hook 'before-revert-hook
'tramp-flush-file-function)
(remove-hook 'kill-buffer-hook
'tramp-flush-file-function)))
;;; -- Properties --
(defun tramp-get-connection-property (key property default)
"Get the named PROPERTY for the connection.
KEY identifies the connection, it is either a process or a vector.
If the value is not set for the connection, returns DEFAULT."
;; Unify key by removing localname from vector. Work with a copy in
;; order to avoid side effects.
(when (vectorp key)
(setq key (copy-sequence key))
(aset key 3 nil))
(let* ((hash (gethash key tramp-cache-data))
(value (if (hash-table-p hash)
(gethash property hash default)
default)))
(tramp-message key 7 "%s %s" property value)
value))
(defun tramp-set-connection-property (key property value)
"Set the named PROPERTY of a connection to VALUE.
KEY identifies the connection, it is either a process or a vector.
PROPERTY is set persistent when KEY is a vector."
;; Unify key by removing localname from vector. Work with a copy in
;; order to avoid side effects.
(when (vectorp key)
(setq key (copy-sequence key))
(aset key 3 nil))
(let ((hash (or (gethash key tramp-cache-data)
(puthash key (make-hash-table :test 'equal)
tramp-cache-data))))
(puthash property value hash)
;; This function is called also during initialization of
;; tramp-cache.el. `tramp-message´ is not defined yet at this
;; time, so we ignore the corresponding error.
(condition-case nil
(tramp-message key 7 "%s %s" property value)
(error nil))
value))
(defun tramp-flush-connection-property (key event)
"Remove all properties identified by KEY.
KEY identifies the connection, it is either a process or a
vector. EVENT is not used, it is just applied because this
function is intended to run also as process sentinel."
;; Unify key by removing localname from vector. Work with a copy in
;; order to avoid side effects.
(when (vectorp key)
(setq key (copy-sequence key))
(aset key 3 nil))
; (tramp-message key 7 "%s" event)
(remhash key tramp-cache-data))
(defun tramp-dump-connection-properties ()
"Writes persistent connection properties into file
`tramp-persistency-file-name'."
;; We shouldn't fail, otherwise (X)Emacs might not be able to be closed.
(condition-case nil
(when (and (hash-table-p tramp-cache-data)
(not (zerop (hash-table-count tramp-cache-data)))
(stringp tramp-persistency-file-name))
(let ((cache (copy-hash-table tramp-cache-data)))
;; Remove temporary data.
(maphash
'(lambda (key value)
(if (and (vectorp key) (not (tramp-file-name-localname key)))
(progn
(remhash "process-name" value)
(remhash "process-buffer" value))
(remhash key cache)))
cache)
;; Dump it.
(with-temp-buffer
(insert
";; -*- emacs-lisp -*-"
;; `time-stamp-string' might not exist in all (X)Emacs flavors.
(condition-case nil
(progn
(format
" <%s %s>\n"
(time-stamp-string "%02y/%02m/%02d %02H:%02M:%02S")
tramp-persistency-file-name))
(error "\n"))
";; Tramp connection history. Don't change this file.\n"
";; You can delete it, forcing Tramp to reapply the checks.\n\n"
(with-output-to-string
(pp (read (format "(%s)" (tramp-cache-print cache))))))
(write-region
(point-min) (point-max) tramp-persistency-file-name))))
(error nil)))
(add-hook 'kill-emacs-hook 'tramp-dump-connection-properties)
(add-hook 'tramp-cache-unload-hook
'(lambda ()
(remove-hook 'kill-emacs-hook
'tramp-dump-connection-properties)))
(defun tramp-parse-connection-properties (method)
"Return a list of (user host) tuples allowed to access for METHOD.
This function is added always in `tramp-get-completion-function'
for all methods. Resulting data are derived from connection
history."
(let (res)
(maphash
'(lambda (key value)
(if (and (vectorp key)
(string-equal method (tramp-file-name-method key))
(not (tramp-file-name-localname key)))
(push (list (tramp-file-name-user key)
(tramp-file-name-host key))
res)))
tramp-cache-data)
res))
;; Read persistent connection history. Applied with
;; `load-in-progress', because it shall be evaluated only once.
(when load-in-progress
(condition-case err
(with-temp-buffer
(insert-file-contents tramp-persistency-file-name)
(let ((list (read (current-buffer)))
element key item)
(while (setq element (pop list))
(setq key (pop element))
(while (setq item (pop element))
(tramp-set-connection-property key (pop item) (car item))))))
(file-error
;; Most likely because the file doesn't exist yet. No message.
(clrhash tramp-cache-data))
(error
;; File is corrupted.
(message "%s" (error-message-string err))
(clrhash tramp-cache-data))))
(provide 'tramp-cache)
;; arch-tag: ee1739b7-7628-408c-9b96-d11a74b05d26
;;; tramp-cache.el ends here

1178
lisp/net/tramp-fish.el Normal file

File diff suppressed because it is too large Load diff

View file

@ -10,8 +10,8 @@
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -19,9 +19,8 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;; along with GNU Emacs; see the file COPYING. If not, see
;; <http://www.gnu.org/licenses/>.
;;; Commentary:
@ -110,10 +109,13 @@ present for backward compatibility."
(list "" "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))
;; Add completion function for FTP method.
(unless (memq system-type '(windows-nt))
(tramp-set-completion-function
tramp-ftp-method
'((tramp-parse-netrc "~/.netrc"))))
(tramp-set-completion-function
tramp-ftp-method
'((tramp-parse-netrc "~/.netrc")))
;; If there is URL syntax, `substitute-in-file-name' needs special
;; handling.
(put 'substitute-in-file-name 'ange-ftp 'tramp-handle-substitute-in-file-name)
(defun tramp-ftp-file-name-handler (operation &rest args)
"Invoke the Ange-FTP handler for OPERATION.
@ -152,13 +154,7 @@ pass to the OPERATION."
(defun tramp-ftp-file-name-p (filename)
"Check if it's a filename that should be forwarded to Ange-FTP."
(let ((v (tramp-dissect-file-name filename)))
(string=
(tramp-find-method
(tramp-file-name-multi-method v)
(tramp-file-name-method v)
(tramp-file-name-user v)
(tramp-file-name-host v))
tramp-ftp-method)))
(string= (tramp-file-name-method v) tramp-ftp-method)))
(add-to-list 'tramp-foreign-file-name-handler-alist
(cons 'tramp-ftp-file-name-p 'tramp-ftp-file-name-handler))
@ -172,8 +168,6 @@ pass to the OPERATION."
;; pretended in `tramp-file-name-handler' otherwise.
;; Furthermore, there are no backup files on FTP hosts.
;; Worth further investigations.
;; * Map /multi:ssh:out@gate:ftp:kai@real.host:/path/to.file
;; on Ange-FTP gateways.
;;; arch-tag: 759fb338-5c63-4b99-bd36-b4d59db91cff
;;; tramp-ftp.el ends here

324
lisp/net/tramp-gw.el Normal file
View file

@ -0,0 +1,324 @@
;;; -*- coding: iso-8859-1; -*-
;;; tramp-gw.el --- Tramp utility functions for HTTP tunnels and SOCKS gateways
;; Copyright (C) 2007 Free Software Foundation, Inc.
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, see
;; <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Access functions for HTTP tunnels and SOCKS gateways from Tramp.
;; SOCKS functionality is implemented by socks.el from the w3 package.
;; HTTP tunnels are partly implemented in socks.el and url-http.el;
;; both implementations are not complete. Therefore, it is
;; implemented in this package.
;;; Code:
(require 'tramp)
;; Pacify byte-compiler
(eval-when-compile
(require 'cl)
(require 'custom))
;; Autoload the socks library. It is used only when we access a SOCKS server.
(autoload 'socks-open-network-stream "socks")
(defvar socks-username (user-login-name))
(defvar socks-server (list "Default server" "socks" 1080 5))
;; Avoid byte-compiler warnings if the byte-compiler supports this.
;; Currently, XEmacs supports this.
(eval-when-compile
(when (featurep 'xemacs)
(byte-compiler-options (warnings (- unused-vars)))))
;; Define HTTP tunnel method ...
(defvar tramp-gw-tunnel-method "tunnel"
"*Method to connect HTTP gateways.")
;; ... and port.
(defvar tramp-gw-default-tunnel-port 8080
"*Default port for HTTP gateways.")
;; Define SOCKS method ...
(defvar tramp-gw-socks-method "socks"
"*Method to connect SOCKS servers.")
;; ... and port.
(defvar tramp-gw-default-socks-port 1080
"*Default port for SOCKS servers.")
;; Add a default for `tramp-default-user-alist'. Default is the local user.
(add-to-list 'tramp-default-user-alist
`(,tramp-gw-tunnel-method nil ,(user-login-name)))
(add-to-list 'tramp-default-user-alist
`(,tramp-gw-socks-method nil ,(user-login-name)))
;; Internal file name functions and variables.
(defvar tramp-gw-vector nil
"Keeps the remote host identification. Needed for Tramp messages.")
(defvar tramp-gw-gw-vector nil
"Current gateway identification vector.")
(defvar tramp-gw-gw-proc nil
"Current gateway process.")
;; This variable keeps the listening process, in order to reuse it for
;; new processes.
(defvar tramp-gw-aux-proc nil
"Process listening on local port, as mediation between SSH and the gateway.")
(defun tramp-gw-gw-proc-sentinel (proc event)
"Delete auxiliary process when we are deleted."
(unless (memq (process-status proc) '(run open))
(tramp-message
tramp-gw-vector 4 "Deleting auxiliary process `%s'" tramp-gw-gw-proc)
(let* (tramp-verbose
(p (tramp-get-connection-property proc "process" nil)))
(when (processp p) (delete-process p)))))
(defun tramp-gw-aux-proc-sentinel (proc event)
"Activate the different filters for involved gateway and auxiliary processes."
(when (memq (process-status proc) '(run open))
;; A new process has been spawned from `tramp-gw-aux-proc'.
(tramp-message
tramp-gw-vector 4
"Opening auxiliary process `%s', speaking with process `%s'"
proc tramp-gw-gw-proc)
(tramp-set-process-query-on-exit-flag proc nil)
;; We don't want debug messages, because the corresponding debug
;; buffer might be undecided.
(let (tramp-verbose)
(tramp-set-connection-property tramp-gw-gw-proc "process" proc)
(tramp-set-connection-property proc "process" tramp-gw-gw-proc))
;; Set the process-filter functions for both processes.
(set-process-filter proc 'tramp-gw-process-filter)
(set-process-filter tramp-gw-gw-proc 'tramp-gw-process-filter)
;; There might be already some output from the gateway process.
(with-current-buffer (process-buffer tramp-gw-gw-proc)
(unless (= (point-min) (point-max))
(let ((s (buffer-string)))
(delete-region (point) (point-max))
(tramp-gw-process-filter tramp-gw-gw-proc s))))))
(defun tramp-gw-process-filter (proc string)
(let (tramp-verbose)
(process-send-string
(tramp-get-connection-property proc "process" nil) string)))
(defun tramp-gw-open-connection (vec gw-vec target-vec)
"Open a remote connection to VEC (see `tramp-file-name' structure).
Take GW-VEC as SOCKS or HTTP gateway, i.e. its method must be a
gateway method. TARGET-VEC identifies where to connect to via
the gateway, it can be different from VEC when there are more
hops to be applied.
It returns a string like \"localhost#port\", which must be used
instead of the host name declared in TARGET-VEC."
;; Remember vectors for property retrieval.
(setq tramp-gw-vector vec
tramp-gw-gw-vector gw-vec)
;; Start listening auxiliary process.
(unless (and (processp tramp-gw-aux-proc)
(memq (process-status tramp-gw-aux-proc) '(listen)))
(let ((aux-vec
(vector "aux" (tramp-file-name-user gw-vec)
(tramp-file-name-host gw-vec) nil)))
(setq tramp-gw-aux-proc
(make-network-process
:name (tramp-buffer-name aux-vec) :buffer nil :host 'local
:server t :noquery t :service t :coding 'binary))
(set-process-sentinel tramp-gw-aux-proc 'tramp-gw-aux-proc-sentinel)
(tramp-set-process-query-on-exit-flag tramp-gw-aux-proc nil)
(tramp-message
vec 4 "Opening auxiliary process `%s', listening on port %d"
tramp-gw-aux-proc (process-contact tramp-gw-aux-proc :service))))
(let* ((gw-method
(intern
(tramp-find-method
(tramp-file-name-method gw-vec)
(tramp-file-name-user gw-vec)
(tramp-file-name-host gw-vec))))
(socks-username
(tramp-find-user
(tramp-file-name-method gw-vec)
(tramp-file-name-user gw-vec)
(tramp-file-name-host gw-vec)))
;; Declare the SOCKS server to be used.
(socks-server
(list "Tramp tempory socks server list"
;; Host name.
(tramp-file-name-real-host gw-vec)
;; Port number.
(or (tramp-file-name-port gw-vec)
(case gw-method
(tunnel tramp-gw-default-tunnel-port)
(socks tramp-gw-default-socks-port)))
;; Type. We support only http and socks5, NO socks4.
;; 'http could be used when HTTP tunnel works in socks.el.
5))
;; The function to be called.
(socks-function
(case gw-method
(tunnel 'tramp-gw-open-network-stream)
(socks 'socks-open-network-stream)))
socks-noproxy)
;; Open SOCKS process.
(setq tramp-gw-gw-proc
(funcall
socks-function
(tramp-buffer-name gw-vec)
(tramp-get-buffer gw-vec)
(tramp-file-name-real-host target-vec)
(tramp-file-name-port target-vec)))
(set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
(tramp-set-process-query-on-exit-flag tramp-gw-gw-proc nil)
(tramp-message
vec 4 "Opened %s process `%s'"
(case gw-method ('tunnel "HTTP tunnel") ('socks "SOCKS"))
tramp-gw-gw-proc)
;; Return the new host for gateway access.
(format "localhost#%d" (process-contact tramp-gw-aux-proc :service))))
(defun tramp-gw-open-network-stream (name buffer host service)
"Open stream to proxy server HOST:SERVICE.
Resulting process has name NAME and buffer BUFFER. If
authentication is requested from proxy server, provide it."
(let ((command (format (concat
"CONNECT %s:%d HTTP/1.1\r\n"
"Host: %s:%d\r\n"
"Connection: keep-alive\r\n"
"User-Agent: Tramp/%s\r\n")
host service host service tramp-version))
(authentication "")
(first t)
found proc)
(while (not found)
;; Clean up.
(when (processp proc) (delete-process proc))
(with-current-buffer buffer (erase-buffer))
;; Open network stream.
(setq proc (open-network-stream
name buffer (nth 1 socks-server) (nth 2 socks-server)))
(set-process-coding-system proc 'binary 'binary)
(tramp-set-process-query-on-exit-flag proc nil)
;; Send CONNECT command.
(process-send-string proc (format "%s%s\r\n" command authentication))
(tramp-message
tramp-gw-vector 6 "\n%s"
(format
"%s%s\r\n" command
(replace-regexp-in-string ;; no password in trace!
"Basic [^\r\n]+" "Basic xxxxx" authentication t)))
(with-current-buffer buffer
;; Trap errors to be traced in the right trace buffer. Often,
;; proxies have a timeout of 60". We wait 65" in order to
;; receive an answer this case.
(condition-case nil
(let (tramp-verbose)
(tramp-wait-for-regexp proc 65 "\r?\n\r?\n"))
(error nil))
;; Check return code.
(goto-char (point-min))
(narrow-to-region
(point-min)
(or (search-forward-regexp "\r?\n\r?\n" nil t) (point-max)))
(tramp-message tramp-gw-vector 6 "\n%s" (buffer-string))
(goto-char (point-min))
(search-forward-regexp "^HTTP/[1-9]\\.[0-9]" nil t)
(case (condition-case nil (read (current-buffer)) (error))
;; Connected.
(200 (setq found t))
;; We need basic authentication.
(401 (setq authentication (tramp-gw-basic-authentication nil first)))
;; Target host not found.
(404 (tramp-error-with-buffer
(current-buffer) tramp-gw-vector 'file-error
"Host %s not found." host))
;; We need basic proxy authentication.
(407 (setq authentication (tramp-gw-basic-authentication t first)))
;; Connection failed.
(503 (tramp-error-with-buffer
(current-buffer) tramp-gw-vector 'file-error
"Connection to %s:%d failed." host service))
;; That doesn't work at all.
(t (tramp-error-with-buffer
(current-buffer) tramp-gw-vector 'file-error
"Access to HTTP server %s:%d failed."
(nth 1 socks-server) (nth 2 socks-server))))
;; Remove HTTP headers.
(delete-region (point-min) (point-max))
(widen)
(setq first nil)))
;; Return the process.
proc))
(defun tramp-gw-basic-authentication (proxy pw-cache)
"Return authentication header for CONNECT, based on server request.
PROXY is an indication whether we need a Proxy-Authorization header
or an Authorization header. If PW-CACHE is non-nil, check for
password in password cache. This is done for the first try only."
;; `tramp-current-*' must be set for `tramp-read-passwd' and
;; `tramp-clear-passwd'.
(let ((tramp-current-method (tramp-file-name-method tramp-gw-gw-vector))
(tramp-current-user (tramp-file-name-user tramp-gw-gw-vector))
(tramp-current-host (tramp-file-name-host tramp-gw-gw-vector)))
(unless pw-cache (tramp-clear-passwd))
;; We are already in the right buffer.
(tramp-message
tramp-gw-vector 5 "%s required"
(if proxy "Proxy authentication" "Authentication"))
;; Search for request header. We accept only basic authentication.
(goto-char (point-min))
(search-forward-regexp
"^\\(Proxy\\|WWW\\)-Authenticate:\\s-*Basic\\s-+realm=")
;; Return authentication string.
(format
"%s: Basic %s\r\n"
(if proxy "Proxy-Authorization" "Authorization")
(base64-encode-string
(format
"%s:%s"
socks-username
(tramp-read-passwd
proc
(format
"Password for %s@[%s]: " socks-username (read (current-buffer)))))))))
(provide 'tramp-gw)
;;; TODO:
;; * Provide descriptive Commentary.
;; * Enable it for several gateway processes in parallel.
;; arch-tag: 277e3a81-fdee-40cf-9e6b-59626292a5e0
;;; tramp-gw.el ends here

File diff suppressed because it is too large Load diff

View file

@ -1,138 +0,0 @@
;;; -*- coding: iso-2022-7bit; -*-
;;; tramp-util.el --- Misc utility functions to use with Tramp
;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007 Free Software Foundation, Inc.
;; Author: kai.grossjohann@gmx.net
;; Keywords: comm, extensions, processes
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; Some misc. utility functions that might go nicely with Tramp.
;; Mostly, these are kluges awaiting real solutions later on.
;;; Code:
(require 'compile)
(require 'tramp)
(add-hook 'tramp-util-unload-hook
'(lambda ()
(when (featurep 'tramp)
(unload-feature 'tramp 'force))))
;; Define a Tramp minor mode. It's intention is to redefine some keys for Tramp
;; specific functions, like compilation.
;; The key remapping works since Emacs 22 only. Unknown for XEmacs.
;; Pacify byte-compiler
(eval-when-compile
(unless (fboundp 'define-minor-mode)
(defalias 'define-minor-mode 'identity)
(defvar tramp-minor-mode))
(unless (featurep 'xemacs)
(defalias 'add-menu-button 'ignore)))
(defvar tramp-minor-mode-map (make-sparse-keymap)
"Keymap for Tramp minor mode.")
(define-minor-mode tramp-minor-mode "Tramp minor mode for utility functions."
:group 'tramp
:global nil
:init-value nil
:lighter " Tramp"
:keymap tramp-minor-mode-map
(setq tramp-minor-mode
(and tramp-minor-mode (tramp-tramp-file-p default-directory))))
(add-hook 'find-file-hooks 'tramp-minor-mode t)
(add-hook 'tramp-util-unload-hook
'(lambda ()
(remove-hook 'find-file-hooks 'tramp-minor-mode)))
(add-hook 'dired-mode-hook 'tramp-minor-mode t)
(add-hook 'tramp-util-unload-hook
'(lambda ()
(remove-hook 'dired-mode-hook 'tramp-minor-mode)))
(defun tramp-remap-command (old-command new-command)
"Replaces bindings of OLD-COMMAND by NEW-COMMAND.
If remapping functionality for keymaps is defined, this happens for all
bindings. Otherwise, only bindings active during invocation are taken
into account. XEmacs menubar bindings are not changed by this."
(if (functionp 'command-remapping)
;; Emacs 22
(eval
`(define-key tramp-minor-mode-map [remap ,old-command] new-command))
;; previous Emacs versions.
(mapcar
'(lambda (x)
(define-key tramp-minor-mode-map x new-command))
(where-is-internal old-command))))
(tramp-remap-command 'compile 'tramp-compile)
(tramp-remap-command 'recompile 'tramp-recompile)
;; XEmacs has an own mimic for menu entries
(when (fboundp 'add-menu-button)
(funcall 'add-menu-button
'("Tools" "Compile")
["Compile..."
(command-execute (if tramp-minor-mode 'tramp-compile 'compile))
:active (fboundp 'compile)])
(funcall 'add-menu-button
'("Tools" "Compile")
["Repeat Compilation"
(command-execute (if tramp-minor-mode 'tramp-recompile 'recompile))
:active (fboundp 'compile)]))
;; Utility functions.
(defun tramp-compile (command)
"Compile on remote host."
(interactive
(if (or compilation-read-command current-prefix-arg)
(list (read-from-minibuffer "Compile command: "
compile-command nil nil
'(compile-history . 1)))
(list compile-command)))
(setq compile-command command)
(save-some-buffers (not compilation-ask-about-save) nil)
(let ((d default-directory))
(save-excursion
(pop-to-buffer (get-buffer-create "*Compilation*") t)
(erase-buffer)
(setq default-directory d)))
(tramp-handle-shell-command command (get-buffer "*Compilation*"))
(pop-to-buffer (get-buffer "*Compilation*"))
(tramp-minor-mode 1)
(compilation-minor-mode 1))
(defun tramp-recompile ()
"Re-compile on remote host."
(interactive)
(save-some-buffers (not compilation-ask-about-save) nil)
(tramp-handle-shell-command compile-command (get-buffer "*Compilation*"))
(pop-to-buffer (get-buffer "*Compilation*"))
(tramp-minor-mode 1)
(compilation-minor-mode 1))
(provide 'tramp-util)
;;; arch-tag: 500f9992-a44e-46d0-83a7-980799251808
;;; tramp-util.el ends here

View file

@ -9,8 +9,8 @@
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -18,9 +18,8 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;; along with GNU Emacs; see the file COPYING. If not, see
;; <http://www.gnu.org/licenses/>.
;;; Commentary:

View file

@ -1,536 +0,0 @@
;;; tramp-vc.el --- Version control integration for TRAMP.el
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007 Free Software Foundation, Inc.
;; Author: Daniel Pittman <daniel@danann.net>
;; Keywords: comm, processes
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; See the main module, 'tramp.el' for discussion of the purpose of TRAMP.
;; This module provides integration between remote files accessed by TRAMP and
;; the Emacs version control system.
;;; Code:
(require 'vc)
;; Old VC defines vc-rcs-release in vc.el, new VC requires extra module.
(unless (boundp 'vc-rcs-release)
(require 'vc-rcs))
(require 'tramp)
;; Avoid byte-compiler warnings if the byte-compiler supports this.
;; Currently, XEmacs supports this.
(eval-when-compile
(when (fboundp 'byte-compiler-options)
(let (unused-vars) ; Pacify Emacs byte-compiler
(defalias 'warnings 'identity) ; Pacify Emacs byte-compiler
(byte-compiler-options (warnings (- unused-vars))))))
;; -- vc --
;; This used to blow away the file-name-handler-alist and reinstall
;; TRAMP into it. This was intended to let VC work remotely. It didn't,
;; at least not in my XEmacs 21.2 install.
;;
;; In any case, tramp-run-real-handler now deals correctly with disabling
;; the things that should be, making this a no-op.
;;
;; I have removed it from the tramp-file-name-handler-alist because the
;; shortened version does nothing. This is for reference only now.
;;
;; Daniel Pittman <daniel@danann.net>
;;
;; (defun tramp-handle-vc-registered (file)
;; "Like `vc-registered' for tramp files."
;; (tramp-run-real-handler 'vc-registered (list file)))
;; `vc-do-command'
;; This function does not deal well with remote files, so we define
;; our own version and make a backup of the original function and
;; call our version for tramp files and the original version for
;; normal files.
;; The following function is pretty much copied from vc.el, but
;; the part that actually executes a command is changed.
;; CCC: this probably works for Emacs 21, too.
(defun tramp-vc-do-command (buffer okstatus command file last &rest flags)
"Like `vc-do-command' but invoked for tramp files.
See `vc-do-command' for more information."
(save-match-data
(and file (setq file (expand-file-name file)))
(if (not buffer) (setq buffer "*vc*"))
(if vc-command-messages
(message "Running `%s' on `%s'..." command file))
(let ((obuf (current-buffer)) (camefrom (current-buffer))
(squeezed nil)
(olddir default-directory)
vc-file status)
(let* ((v (tramp-dissect-file-name (expand-file-name file)))
(multi-method (tramp-file-name-multi-method v))
(method (tramp-file-name-method v))
(user (tramp-file-name-user v))
(host (tramp-file-name-host v))
(localname (tramp-file-name-localname v)))
(set-buffer (get-buffer-create buffer))
(set (make-local-variable 'vc-parent-buffer) camefrom)
(set (make-local-variable 'vc-parent-buffer-name)
(concat " from " (buffer-name camefrom)))
(setq default-directory olddir)
(erase-buffer)
(mapcar
(function
(lambda (s) (and s (setq squeezed (append squeezed (list s))))))
flags)
(if (and (eq last 'MASTER) file
(setq vc-file (vc-name file)))
(setq squeezed
(append squeezed
(list (tramp-file-name-localname
(tramp-dissect-file-name vc-file))))))
(if (and file (eq last 'WORKFILE))
(progn
(let* ((pwd (expand-file-name default-directory))
(preflen (length pwd)))
(if (string= (substring file 0 preflen) pwd)
(setq file (substring file preflen))))
(setq squeezed (append squeezed (list file)))))
;; Unless we (save-window-excursion) the layout of windows in
;; the current frame changes. This is painful, at best.
;;
;; As a point of note, (save-excursion) is still here only because
;; it preserves (point) in the current buffer. (save-window-excursion)
;; does not, at least under XEmacs 21.2.
;;
;; I trust that the FSF support this as well. I can't find useful
;; documentation to check :(
;;
;; Daniel Pittman <daniel@danann.net>
(save-excursion
(save-window-excursion
;; Actually execute remote command
;; `shell-command' cannot be used; it isn't magic in XEmacs.
(tramp-handle-shell-command
(mapconcat 'tramp-shell-quote-argument
(cons command squeezed) " ") t)
;;(tramp-wait-for-output)
;; Get status from command
(tramp-send-command multi-method method user host "echo $?")
(tramp-wait-for-output)
;; Make sure to get status from last line of output.
(goto-char (point-max)) (forward-line -1)
(setq status (read (current-buffer)))
(message "Command %s returned status %d." command status)))
(goto-char (point-max))
(set-buffer-modified-p nil)
(forward-line -1)
(if (or (not (integerp status))
(and (integerp okstatus) (< okstatus status)))
(progn
(pop-to-buffer buffer)
(goto-char (point-min))
(shrink-window-if-larger-than-buffer)
(error "Running `%s'...FAILED (%s)" command
(if (integerp status)
(format "status %d" status)
status))
)
(if vc-command-messages
(message "Running %s...OK" command))
)
(set-buffer obuf)
status))
))
;; Following code snarfed from Emacs 21 vc.el and slightly tweaked.
(defun tramp-vc-do-command-new (buffer okstatus command file &rest flags)
"Like `vc-do-command' but for TRAMP files.
This function is for the new VC which comes with Emacs 21.
Since TRAMP doesn't do async commands yet, this function doesn't, either."
(and file (setq file (expand-file-name file)))
(if vc-command-messages
(message "Running %s on %s..." command file))
(save-current-buffer
(unless (eq buffer t)
; Pacify byte-compiler
(funcall (symbol-function 'vc-setup-buffer) buffer))
(let ((squeezed nil)
(inhibit-read-only t)
(status 0))
(let* ((v (when file (tramp-dissect-file-name file)))
(multi-method (when file (tramp-file-name-multi-method v)))
(method (when file (tramp-file-name-method v)))
(user (when file (tramp-file-name-user v)))
(host (when file (tramp-file-name-host v)))
(localname (when file (tramp-file-name-localname v))))
(setq squeezed (delq nil (copy-sequence flags)))
(when file
(setq squeezed (append squeezed (list (file-relative-name
file default-directory)))))
(let ((w32-quote-process-args t))
(when (eq okstatus 'async)
(message "Tramp doesn't do async commands, running synchronously."))
;; `shell-command' cannot be used; it isn't magic in XEmacs.
(setq status (tramp-handle-shell-command
(mapconcat 'tramp-shell-quote-argument
(cons command squeezed) " ") t))
(when (or (not (integerp status))
(and (integerp okstatus) (< okstatus status)))
(pop-to-buffer (current-buffer))
(goto-char (point-min))
(shrink-window-if-larger-than-buffer)
(error "Running %s...FAILED (%s)" command
(if (integerp status) (format "status %d" status) status))))
(if vc-command-messages
(message "Running %s...OK" command))
; Pacify byte-compiler
(funcall (symbol-function 'vc-exec-after)
`(run-hook-with-args
'vc-post-command-functions ',command ',localname ',flags))
status))))
;; The context for a VC command is the current buffer.
;; That makes a test on the buffers file more reliable than a test on the
;; arguments.
;; This is needed to handle remote VC correctly - else we test against the
;; local VC system and get things wrong...
;; Daniel Pittman <daniel@danann.net>
;;-(if (fboundp 'vc-call-backend)
;;- () ;; This is the new VC for which we don't have an appropriate advice yet
;;-)
(unless (fboundp 'process-file)
(if (fboundp 'vc-call-backend)
(defadvice vc-do-command
(around tramp-advice-vc-do-command
(buffer okstatus command file &rest flags)
activate)
"Invoke tramp-vc-do-command for tramp files."
(let ((file (symbol-value 'file))) ;pacify byte-compiler
(if (or (and (stringp file) (tramp-tramp-file-p file))
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))))
(setq ad-return-value
(apply 'tramp-vc-do-command-new buffer okstatus command
file ;(or file (buffer-file-name))
flags))
ad-do-it)))
(defadvice vc-do-command
(around tramp-advice-vc-do-command
(buffer okstatus command file last &rest flags)
activate)
"Invoke tramp-vc-do-command for tramp files."
(let ((file (symbol-value 'file))) ;pacify byte-compiler
(if (or (and (stringp file) (tramp-tramp-file-p file))
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))))
(setq ad-return-value
(apply 'tramp-vc-do-command buffer okstatus command
(or file (buffer-file-name)) last flags))
ad-do-it))))
(add-hook 'tramp-unload-hook
'(lambda () (ad-unadvise 'vc-do-command))))
;; XEmacs uses this to do some of its work. Like vc-do-command, we
;; need to enhance it to make VC work via TRAMP-mode.
;;
;; Like the previous function, this is a cut-and-paste job from the VC
;; file. It's based on the vc-do-command code.
;; CCC: this isn't used in Emacs 21, so do as before.
(defun tramp-vc-simple-command (okstatus command file &rest args)
;; Simple version of vc-do-command, for use in vc-hooks only.
;; Don't switch to the *vc-info* buffer before running the
;; command, because that would change its default directory
(save-match-data
(let* ((v (tramp-dissect-file-name (expand-file-name file)))
(multi-method (tramp-file-name-multi-method v))
(method (tramp-file-name-method v))
(user (tramp-file-name-user v))
(host (tramp-file-name-host v))
(localname (tramp-file-name-localname v)))
(save-excursion (set-buffer (get-buffer-create "*vc-info*"))
(erase-buffer))
(let ((exec-path (append vc-path exec-path)) exec-status
;; Add vc-path to PATH for the execution of this command.
(process-environment
(cons (concat "PATH=" (getenv "PATH")
path-separator
(mapconcat 'identity vc-path path-separator))
process-environment)))
;; Call the actual process. See tramp-vc-do-command for discussion of
;; why this does both (save-window-excursion) and (save-excursion).
;;
;; As a note, I don't think that the process-environment stuff above
;; has any effect on the remote system. This is a hard one though as
;; there is no real reason to expect local and remote paths to be
;; identical...
;;
;; Daniel Pittman <daniel@danann.net>
(save-excursion
(save-window-excursion
;; Actually execute remote command
;; `shell-command' cannot be used; it isn't magic in XEmacs.
(tramp-handle-shell-command
(mapconcat 'tramp-shell-quote-argument
(append (list command) args (list localname)) " ")
(get-buffer-create"*vc-info*"))
;(tramp-wait-for-output)
;; Get status from command
(tramp-send-command multi-method method user host "echo $?")
(tramp-wait-for-output)
(setq exec-status (read (current-buffer)))
(message "Command %s returned status %d." command exec-status)))
;; Maybe okstatus can be `async' here. But then, maybe the
;; async thing is new in Emacs 21, but this function is only
;; used in Emacs 20.
(cond ((> exec-status okstatus)
(switch-to-buffer (get-file-buffer file))
(shrink-window-if-larger-than-buffer
(display-buffer "*vc-info*"))
(error "Couldn't find version control information")))
exec-status))))
;; This function does not exist any more in Emacs-21's VC
(defadvice vc-simple-command
(around tramp-advice-vc-simple-command
(okstatus command file &rest args)
activate)
"Invoke tramp-vc-simple-command for tramp files."
(let ((file (symbol-value 'file))) ;pacify byte-compiler
(if (or (and (stringp file) (tramp-tramp-file-p file))
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))))
(setq ad-return-value
(apply 'tramp-vc-simple-command okstatus command
(or file (buffer-file-name)) args))
ad-do-it)))
(add-hook 'tramp-unload-hook
'(lambda () (ad-unadvise 'vc-simple-command)))
;; `vc-workfile-unchanged-p'
;; This function does not deal well with remote files, so we do the
;; same as for `vc-do-command'.
;; `vc-workfile-unchanged-p' checks the modification time, we cannot
;; do that for remote files, so here's a version which relies on diff.
;; CCC: this one probably works for Emacs 21, too.
(defun tramp-vc-workfile-unchanged-p
(filename &optional want-differences-if-changed)
(if (fboundp 'vc-backend-diff)
;; Old VC. Call `vc-backend-diff'.
(let ((status (funcall (symbol-function 'vc-backend-diff)
filename nil nil
(not want-differences-if-changed))))
(zerop status))
;; New VC. Call `vc-default-workfile-unchanged-p'.
(funcall (symbol-function 'vc-default-workfile-unchanged-p)
(vc-backend filename) filename)))
(defadvice vc-workfile-unchanged-p
(around tramp-advice-vc-workfile-unchanged-p
(filename &optional want-differences-if-changed)
activate)
"Invoke tramp-vc-workfile-unchanged-p for tramp files."
(if (and (stringp filename)
(tramp-tramp-file-p filename)
(not
(let ((v (tramp-dissect-file-name filename)))
;; The following check is probably to test whether
;; file-attributes returns correct last modification
;; times. This check needs to be changed.
(tramp-get-remote-perl (tramp-file-name-multi-method v)
(tramp-file-name-method v)
(tramp-file-name-user v)
(tramp-file-name-host v)))))
(setq ad-return-value
(tramp-vc-workfile-unchanged-p filename want-differences-if-changed))
ad-do-it))
(add-hook 'tramp-unload-hook
'(lambda () (ad-unadvise 'vc-workfile-unchanged-p)))
;; Redefine a function from vc.el -- allow tramp files.
;; `save-match-data' seems not to be required -- it isn't in
;; the original version, either.
;; CCC: this might need some work -- how does the Emacs 21 version
;; work, anyway? Does it work over ange-ftp? Hm.
(if (not (fboundp 'vc-backend-checkout))
() ;; our replacement won't work and is unnecessary anyway
(defun vc-checkout (filename &optional writable rev)
"Retrieve a copy of the latest version of the given file."
;; If ftp is on this system and the name matches the ange-ftp format
;; for a remote file, the user is trying something that won't work.
(funcall (symbol-function 'vc-backend-checkout) filename writable rev)
(vc-resynch-buffer filename t t))
)
;; Do we need to advise the vc-user-login-name function anyway?
;; This will return the correct login name for the owner of a
;; file. It does not deal with the default remote user name...
;;
;; That is, when vc calls (vc-user-login-name), we return the
;; local login name, something that may be different to the remote
;; default.
;;
;; The remote VC operations will occur as the user that we logged
;; in with however - not always the same as the local user.
;;
;; In the end, I did advise the function. This is because, well,
;; the thing didn't work right otherwise ;)
;;
;; Daniel Pittman <daniel@danann.net>
(defun tramp-handle-vc-user-login-name (&optional uid)
"Return the default user name on the remote machine.
Whenever VC calls this function, `file' is bound to the file name
in question. If no uid is provided or the uid is equal to the uid
owning the file, then we return the user name given in the file name.
This should only be called when `file' is bound to the
filename we are thinking about..."
;; Pacify byte-compiler; this symbol is bound in the calling
;; function. CCC: Maybe it would be better to move the
;; boundness-checking into this function?
(let* ((file (symbol-value 'file))
(remote-uid
;; With Emacs 22, `file-attributes' has got an optional parameter
;; ID-FORMAT. Handle this case backwards compatible.
(if (and (functionp 'subr-arity)
(= 2 (cdr (funcall (symbol-function 'subr-arity)
(symbol-function 'file-attributes)))))
(nth 2 (file-attributes file 'integer))
(nth 2 (file-attributes file)))))
(if (and uid (/= uid remote-uid))
(error "tramp-handle-vc-user-login-name cannot map a uid to a name")
(let* ((v (tramp-dissect-file-name (expand-file-name file)))
(u (tramp-file-name-user v)))
(cond ((stringp u) u)
((vectorp u) (elt u (1- (length u))))
((null u) (user-login-name))
(t (error "tramp-handle-vc-user-login-name cannot cope!")))))))
;; The following defadvice is no longer necessary after changes in VC
;; on 2006-01-25, Andre.
(unless (fboundp 'process-file)
(defadvice vc-user-login-name
(around tramp-vc-user-login-name activate)
"Support for files on remote machines accessed by TRAMP."
;; We rely on the fact that `file' is bound when this is called.
;; This appears to be the case everywhere in vc.el and vc-hooks.el
;; as of Emacs 20.5.
;;
;; With Emacs 22, the definition of `vc-user-login-name' has been
;; changed. It doesn't need to be adviced any longer.
(let ((file (when (boundp 'file)
(symbol-value 'file)))) ;pacify byte-compiler
(or (and (stringp file)
(tramp-tramp-file-p file) ; tramp file
(setq ad-return-value
(save-match-data
(tramp-handle-vc-user-login-name uid)))) ; get the owner name
ad-do-it))) ; else call the original
(add-hook 'tramp-unload-hook
'(lambda () (ad-unadvise 'vc-user-login-name))))
;; Determine the name of the user owning a file.
(defun tramp-file-owner (filename)
"Return who owns FILE (user name, as a string)."
(let ((v (tramp-dissect-file-name
(expand-file-name filename))))
(if (not (file-exists-p filename))
nil ; file cannot be opened
;; file exists, find out stuff
(save-excursion
(tramp-send-command
(tramp-file-name-multi-method v) (tramp-file-name-method v)
(tramp-file-name-user v) (tramp-file-name-host v)
(format "%s -Lld %s"
(tramp-get-ls-command (tramp-file-name-multi-method v)
(tramp-file-name-method v)
(tramp-file-name-user v)
(tramp-file-name-host v))
(tramp-shell-quote-argument (tramp-file-name-localname v))))
(tramp-wait-for-output)
;; parse `ls -l' output ...
;; ... file mode flags
(read (current-buffer))
;; ... number links
(read (current-buffer))
;; ... uid (as a string)
(symbol-name (read (current-buffer)))))))
;; Wire ourselves into the VC infrastructure...
;; This function does not exist any more in Emacs-21's VC
;; CCC: it appears that no substitute is needed for Emacs 21.
(defadvice vc-file-owner
(around tramp-vc-file-owner activate)
"Support for files on remote machines accessed by TRAMP."
(let ((filename (ad-get-arg 0)))
(or (and (tramp-file-name-p filename) ; tramp file
(setq ad-return-value
(save-match-data
(tramp-file-owner filename)))) ; get the owner name
ad-do-it))) ; else call the original
(add-hook 'tramp-unload-hook
'(lambda () (ad-unadvise 'vc-file-owner)))
;; We need to make the version control software backend version
;; information local to the current buffer. This is because each TRAMP
;; buffer can (theoretically) have a different VC version and I am
;; *way* too lazy to try and push the correct value into each new
;; buffer.
;;
;; Remote VC costs will just have to be paid, at least for the moment.
;; Well, at least, they will right until I feel guilty about doing a
;; botch job here and fix it. :/
;;
;; Daniel Pittman <daniel@danann.net>
;; CCC: this is probably still needed for Emacs 21.
(defun tramp-vc-setup-for-remote ()
"Make the backend release variables buffer local.
This makes remote VC work correctly at the cost of some processing time."
(when (and (buffer-file-name)
(tramp-tramp-file-p (buffer-file-name)))
(make-local-variable 'vc-rcs-release)
(setq vc-rcs-release nil)))
(add-hook 'find-file-hooks 'tramp-vc-setup-for-remote t)
(add-hook 'tramp-unload-hook
'(lambda ()
(remove-hook 'find-file-hooks 'tramp-vc-setup-for-remote)))
;; No need to load this again if anyone asks.
(provide 'tramp-vc)
;;; arch-tag: 27cc42ce-da19-468d-ad5c-a2690558db60
;;; tramp-vc.el ends here

File diff suppressed because it is too large Load diff

View file

@ -11,8 +11,8 @@
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -20,22 +20,26 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;; along with GNU Emacs; see the file COPYING. If not, see
;; <http://www.gnu.org/licenses/>.
;;; Code:
;; In the Tramp CVS repository, the version numer and the bug report address
;; are auto-frobbed from configure.ac, so you should edit that file and run
;; "autoconf && ./configure" to change them.
;; "autoconf && ./configure" to change them. (X)Emacs version check is defined
;; in macro AC_EMACS_INFO of aclocal.m4; should be changed only there.
(defconst tramp-version "2.0.56"
(defconst tramp-version "2.1.10-pre"
"This version of Tramp.")
(defconst tramp-bug-report-address "tramp-devel@gnu.org"
"Email address to send bug reports to.")
;; Check for (X)Emacs version.
(let ((x (if (or (< emacs-major-version 21) (and (featurep 'xemacs) (< emacs-minor-version 4))) (format "Tramp 2.1.10-pre is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version)))) "ok")))
(unless (string-match "\\`ok\\'" x) (error x)))
(provide 'trampver)
;;; arch-tag: 443576ca-f8f1-4bb1-addc-5c70861e93b1

View file

@ -711,6 +711,7 @@ If PREDICATE is non-nil, it will also be used to refine the match
If no directory information can be extracted from the completed
component, `default-directory' is used as the basis for completion."
(let* ((name (substitute-env-vars pcomplete-stub))
(completion-ignore-case pcomplete-ignore-case)
(default-directory (expand-file-name
(or (file-name-directory name)
default-directory)))

View file

@ -85,9 +85,9 @@ to confuse some users sometimes."
(defface cvs-unknown
'((((class color) (background dark))
(:foreground "red"))
(:foreground "red1"))
(((class color) (background light))
(:foreground "red"))
(:foreground "red1"))
(t (:slant italic)))
"PCL-CVS face used to highlight unknown file status."
:group 'pcl-cvs)

View file

@ -87,13 +87,13 @@
;;;###autoload
(defcustom compilation-mode-hook nil
"*List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
"List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
:type 'hook
:group 'compilation)
;;;###autoload
(defcustom compilation-window-height nil
"*Number of lines in a compilation window. If nil, use Emacs default."
"Number of lines in a compilation window. If nil, use Emacs default."
:type '(choice (const :tag "Default" nil)
integer)
:group 'compilation)
@ -442,7 +442,7 @@ Highlight entire line if t; don't highlight source lines if nil.")
"Overlay used to temporarily highlight compilation matches.")
(defcustom compilation-error-screen-columns t
"*If non-nil, column numbers in error messages are screen columns.
"If non-nil, column numbers in error messages are screen columns.
Otherwise they are interpreted as character positions, with
each character occupying one column.
The default is to use screen columns, which requires that the compilation
@ -453,21 +453,21 @@ especially the TAB character."
:version "20.4")
(defcustom compilation-read-command t
"*Non-nil means \\[compile] reads the compilation command to use.
"Non-nil means \\[compile] reads the compilation command to use.
Otherwise, \\[compile] just uses the value of `compile-command'."
:type 'boolean
:group 'compilation)
;;;###autoload
(defcustom compilation-ask-about-save t
"*Non-nil means \\[compile] asks which buffers to save before compiling.
"Non-nil means \\[compile] asks which buffers to save before compiling.
Otherwise, it saves all modified buffers without asking."
:type 'boolean
:group 'compilation)
;;;###autoload
(defcustom compilation-search-path '(nil)
"*List of directories to search for source files named in error messages.
"List of directories to search for source files named in error messages.
Elements should be directory names, not file names of directories.
The value nil as an element means to try the default directory."
:type '(repeat (choice (const :tag "Default" nil)
@ -476,7 +476,7 @@ The value nil as an element means to try the default directory."
;;;###autoload
(defcustom compile-command "make -k "
"*Last shell command used to do a compilation; default for next compilation.
"Last shell command used to do a compilation; default for next compilation.
Sometimes it is useful for files to supply local values for this variable.
You might also use mode hooks to specify it in certain modes, like this:
@ -494,7 +494,7 @@ You might also use mode hooks to specify it in certain modes, like this:
;;;###autoload
(defcustom compilation-disable-input nil
"*If non-nil, send end-of-file as compilation process input.
"If non-nil, send end-of-file as compilation process input.
This only affects platforms that support asynchronous processes (see
`start-process'); synchronous compilation processes never accept input."
:type 'boolean
@ -605,6 +605,14 @@ Faces `compilation-error-face', `compilation-warning-face',
(defvar compilation-error-list nil)
(defvar compilation-old-error-list nil)
(defcustom compilation-auto-jump-to-first-error nil
"If non-nil, automatically jump to the first error after `compile'."
:type 'boolean)
(defvar compilation-auto-jump-to-next nil
"If non-nil, automatically jump to the next error encountered.")
(make-variable-buffer-local 'compilation-auto-jump-to-next)
(defun compilation-face (type)
(or (and (car type) (match-end (car type)) compilation-warning-face)
(and (cdr type) (match-end (cdr type)) compilation-info-face)
@ -652,13 +660,18 @@ Faces `compilation-error-face', `compilation-warning-face',
l2
(setcdr l1 (cons (list ,key) l2)))))))
(defun compilation-auto-jump (buffer pos)
(with-current-buffer buffer
(goto-char pos)
(compile-goto-error)))
;; This function is the central driver, called when font-locking to gather
;; all information needed to later jump to corresponding source code.
;; Return a property list with all meta information on this error location.
(defun compilation-error-properties (file line end-line col end-col type fmt)
(unless (< (next-single-property-change (match-beginning 0) 'directory nil (point))
(unless (< (next-single-property-change (match-beginning 0)
'directory nil (point))
(point))
(if file
(if (functionp file)
@ -710,6 +723,13 @@ Faces `compilation-error-face', `compilation-warning-face',
(setq type (or (and (car type) (match-end (car type)) 1)
(and (cdr type) (match-end (cdr type)) 0)
2)))
(when (and compilation-auto-jump-to-next
(>= type compilation-skip-threshold))
(kill-local-variable 'compilation-auto-jump-to-next)
(run-with-timer 0 nil 'compilation-auto-jump
(current-buffer) (match-beginning 0)))
(compilation-internal-error-properties file line end-line col end-col type fmt)))
(defun compilation-move-to-column (col screen)
@ -932,7 +952,7 @@ original use. Otherwise, recompile using `compile-command'."
`(,(eval compile-command))))))
(defcustom compilation-scroll-output nil
"*Non-nil to scroll the *compilation* buffer window as output appears.
"Non-nil to scroll the *compilation* buffer window as output appears.
Setting it causes the Compilation mode commands to put point at the
end of their output window so that the end of the output is always
@ -1026,8 +1046,9 @@ Returns the compilation buffer created."
;; Clear out the compilation buffer.
(let ((inhibit-read-only t)
(default-directory thisdir))
;; Then evaluate a cd command if any, but don't perform it yet, else start-command
;; would do it again through the shell: (cd "..") AND sh -c "cd ..; make"
;; Then evaluate a cd command if any, but don't perform it yet, else
;; start-command would do it again through the shell: (cd "..") AND
;; sh -c "cd ..; make"
(cd (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" command)
(if (match-end 1)
(substitute-env-vars (match-string 1 command))
@ -1043,6 +1064,8 @@ Returns the compilation buffer created."
(if highlight-regexp
(set (make-local-variable 'compilation-highlight-regexp)
highlight-regexp))
(if compilation-auto-jump-to-first-error
(set (make-local-variable 'compilation-auto-jump-to-next) t))
;; Output a mode setter, for saving and later reloading this buffer.
(insert "-*- mode: " name-of-mode
"; default-directory: " (prin1-to-string default-directory)
@ -1075,7 +1098,8 @@ Returns the compilation buffer created."
(unless (getenv "EMACS")
(list "EMACS=t"))
(list "INSIDE_EMACS=t")
(copy-sequence process-environment))))
(copy-sequence process-environment)))
(start-process (symbol-function 'start-process)))
(set (make-local-variable 'compilation-arguments)
(list command mode name-function highlight-regexp))
(set (make-local-variable 'revert-buffer-function)
@ -1091,53 +1115,39 @@ Returns the compilation buffer created."
(funcall compilation-process-setup-function))
(compilation-set-window-height outwin)
;; Start the compilation.
(if (fboundp 'start-process)
(let ((proc (if (eq mode t)
(get-buffer-process
(with-no-warnings
(comint-exec outbuf (downcase mode-name)
shell-file-name nil `("-c" ,command))))
(start-process-shell-command (downcase mode-name)
outbuf command))))
;; Make the buffer's mode line show process state.
(setq mode-line-process '(":%s"))
(set-process-sentinel proc 'compilation-sentinel)
(set-process-filter proc 'compilation-filter)
(set-marker (process-mark proc) (point) outbuf)
(when compilation-disable-input
(condition-case nil
(process-send-eof proc)
;; The process may have exited already.
(error nil)))
(setq compilation-in-progress
(cons proc compilation-in-progress)))
;; No asynchronous processes available.
(message "Executing `%s'..." command)
;; Fake modeline display as if `start-process' were run.
(setq mode-line-process ":run")
(force-mode-line-update)
(sit-for 0) ; Force redisplay
(let* ((buffer-read-only nil) ; call-process needs to modify outbuf
(status (call-process shell-file-name nil outbuf nil "-c"
command)))
(cond ((numberp status)
(compilation-handle-exit 'exit status
(if (zerop status)
"finished\n"
(format "\
exited abnormally with code %d\n"
status))))
((stringp status)
(compilation-handle-exit 'signal status
(concat status "\n")))
(t
(compilation-handle-exit 'bizarre status status))))
;; Without async subprocesses, the buffer is not yet
;; fontified, so fontify it now.
(let ((font-lock-verbose nil)) ; shut up font-lock messages
(font-lock-fontify-buffer))
(set-buffer-modified-p nil)
(message "Executing `%s'...done" command)))
(let ((proc
(if (eq mode t)
;; comint uses `start-file-process'.
(get-buffer-process
(with-no-warnings
(comint-exec outbuf (downcase mode-name)
shell-file-name nil `("-c" ,command))))
;; Redefine temporarily `start-process' in order to
;; handle remote compilation.
(fset 'start-process
(lambda (name buffer program &rest program-args)
(apply
(if (file-remote-p default-directory)
'start-file-process
start-process)
name buffer program program-args)))
(unwind-protect
(start-process-shell-command (downcase mode-name)
outbuf command)
;; Unwindform: Reset original definition of `start-process'.
(fset 'start-process start-process)))))
;; Make the buffer's mode line show process state.
(setq mode-line-process '(":%s"))
(set-process-sentinel proc 'compilation-sentinel)
(set-process-filter proc 'compilation-filter)
(set-marker (process-mark proc) (point) outbuf)
(when compilation-disable-input
(condition-case nil
(process-send-eof proc)
;; The process may have exited already.
(error nil)))
(setq compilation-in-progress
(cons proc compilation-in-progress))))
;; Now finally cd to where the shell started make/grep/...
(setq default-directory thisdir))
(if (buffer-local-value 'compilation-scroll-output outbuf)
@ -1258,7 +1268,7 @@ exited abnormally with code %d\n"
"*If non-nil, skip multiple error messages for the same source location.")
(defcustom compilation-skip-threshold 1
"*Compilation motion commands skip less important messages.
"Compilation motion commands skip less important messages.
The value can be either 2 -- skip anything less than error, 1 --
skip anything less than warning or 0 -- don't skip any messages.
Note that all messages not positively identified as warning or
@ -1270,7 +1280,7 @@ info, are considered errors."
:version "22.1")
(defcustom compilation-skip-visited nil
"*Compilation motion commands skip visited messages if this is t.
"Compilation motion commands skip visited messages if this is t.
Visited messages are ones for which the file, line and column have been jumped
to from the current content in the current compilation buffer, even if it was
from a different message."
@ -1371,6 +1381,8 @@ Optional argument MINOR indicates this is called from
;; with the next-error function in simple.el, and it's only
;; coincidentally named similarly to compilation-next-error.
(setq next-error-function 'compilation-next-error-function)
(set (make-local-variable 'comint-file-name-prefix)
(or (file-remote-p default-directory) ""))
(set (make-local-variable 'font-lock-extra-managed-props)
'(directory message help-echo mouse-face debug))
(set (make-local-variable 'compilation-locs)

View file

@ -1765,7 +1765,7 @@ static char *magick[] = {
(defface breakpoint-enabled
'((t
:foreground "red"
:foreground "red1"
:weight bold))
"Face for enabled breakpoint icon in fringe."
:group 'gud)

View file

@ -237,7 +237,7 @@ Used to grey out relevant toolbar icons.")
([menu-bar run] menu-item
,(propertize "run" 'face 'font-lock-doc-face) gud-run
:visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
([menu-bar go] menu-item
([menu-bar go] menu-item
,(propertize " go " 'face 'font-lock-doc-face) gud-go
:visible (and (not gud-running)
(eq gud-minor-mode 'gdba)))
@ -292,6 +292,11 @@ Used to grey out relevant toolbar icons.")
(defun gud-file-name (f)
"Transform a relative file name to an absolute file name.
Uses `gud-<MINOR-MODE>-directories' to find the source files."
;; When `default-directory' is a remote file name, prepend its
;; remote part to f, which is the local file name. Fortunately,
;; `file-remote-p' returns exactly this remote file name part (or
;; nil otherwise).
(setq f (concat (or (file-remote-p default-directory) "") f))
(if (file-exists-p f) (expand-file-name f)
(let ((directories (gud-val 'directories))
(result nil))
@ -2510,7 +2515,10 @@ comint mode, which see."
(while (and w (not (eq (car w) t)))
(setq w (cdr w)))
(if w
(setcar w file)))
(setcar w
(if (file-remote-p default-directory)
(setq file (file-name-nondirectory file))
file))))
(apply 'make-comint (concat "gud" filepart) program nil
(if massage-args (funcall massage-args file args) args))
;; Since comint clobbered the mode, we don't set it until now.
@ -3114,7 +3122,7 @@ class of the file (using s to separate nested class ids)."
'syntax-table (eval-when-compile
(string-to-syntax "> b")))
;; Make sure that rehighlighting the previous line won't erase our
;; syntax-table property.
;; syntax-table property.
(put-text-property (1- (match-beginning 0)) (match-end 0)
'font-lock-multiline t)
nil)))))
@ -3193,8 +3201,12 @@ Treats actions as defuns."
(goto-char (point-max)))
t)
;; Besides .gdbinit, gdb documents other names to be usable for init
;; files, cross-debuggers can use something like
;; .PROCESSORNAME-gdbinit so that the host and target gdbinit files
;; don't interfere with each other.
;;;###autoload
(add-to-list 'auto-mode-alist '("/\\.gdbinit" . gdb-script-mode))
(add-to-list 'auto-mode-alist '("/\\.[a-z0-9-]*gdbinit" . gdb-script-mode))
;;;###autoload
(define-derived-mode gdb-script-mode nil "GDB-Script"

View file

@ -996,7 +996,16 @@ don't move and return nil. Otherwise return t."
(throw 'done t)))))))
(setq arg (1- arg)))
(zerop arg)))
(defvar python-which-func-length-limit 40
"Non-strict length limit for `python-which-func' output.")
(defun python-which-func ()
(let ((function-name (python-current-defun python-which-func-length-limit)))
(set-text-properties 0 (length function-name) nil function-name)
function-name))
;;;; Imenu.
(defvar python-recursing)
@ -1814,22 +1823,30 @@ of current line."
(1+ (/ (current-indentation) python-indent)))
;; Fixme: Consider top-level assignments, imports, &c.
(defun python-current-defun ()
(defun python-current-defun (&optional length-limit)
"`add-log-current-defun-function' for Python."
(save-excursion
;; Move up the tree of nested `class' and `def' blocks until we
;; get to zero indentation, accumulating the defined names.
(let ((start t)
accum)
(while (or start (> (current-indentation) 0))
(accum)
(length -1))
(while (and (or start (> (current-indentation) 0))
(or (null length-limit)
(null (cdr accum))
(< length length-limit)))
(setq start nil)
(python-beginning-of-block)
(end-of-line)
(beginning-of-defun)
(if (looking-at (rx (0+ space) (or "def" "class") (1+ space)
(group (1+ (or word (syntax symbol))))))
(push (match-string 1) accum)))
(if accum (mapconcat 'identity accum ".")))))
(when (looking-at (rx (0+ space) (or "def" "class") (1+ space)
(group (1+ (or word (syntax symbol))))))
(push (match-string 1) accum)
(setq length (+ length 1 (length (car accum))))))
(when accum
(when (and length-limit (> length length-limit))
(setcar accum ".."))
(mapconcat 'identity accum ".")))))
(defun python-mark-block ()
"Mark the block around point.
@ -2248,6 +2265,7 @@ with skeleton expansions for compound statement templates.
(set (make-local-variable 'beginning-of-defun-function)
'python-beginning-of-defun)
(set (make-local-variable 'end-of-defun-function) 'python-end-of-defun)
(add-hook 'which-func-functions 'python-which-func nil t)
(setq imenu-create-index-function #'python-imenu-create-index)
(set (make-local-variable 'eldoc-documentation-function)
#'python-eldoc-function)

View file

@ -76,8 +76,8 @@
:version "20.3")
(defcustom which-func-modes
'(emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode makefile-mode
sh-mode fortran-mode f90-mode ada-mode)
'(emacs-lisp-mode c-mode c++-mode perl-mode cperl-mode python-mode
makefile-mode sh-mode fortran-mode f90-mode ada-mode)
"List of major modes for which Which Function mode should be used.
For other modes it is disabled. If this is equal to t,
then Which Function mode is enabled in any major mode that supports it."

View file

@ -860,7 +860,7 @@ Compatibility function for \\[next-error] invocations."
(defface match
'((((class color) (min-colors 88) (background light))
:background "yellow")
:background "yellow1")
(((class color) (min-colors 88) (background dark))
:background "RoyalBlue3")
(((class color) (min-colors 8) (background light))

View file

@ -103,7 +103,7 @@ change the list."
When COND yields non-nil, eval BODY forms sequentially and return
value of last one, or nil if there are none.
\(fn COND BODY ...)"
\(fn COND BODY...)"
(declare (indent 1) (debug t))
(list 'if cond (cons 'progn body)))
@ -112,7 +112,7 @@ value of last one, or nil if there are none.
When COND yields nil, eval BODY forms sequentially and return
value of last one, or nil if there are none.
\(fn COND BODY ...)"
\(fn COND BODY...)"
(declare (indent 1) (debug t))
(cons 'if (cons cond (cons nil body))))
@ -510,6 +510,7 @@ Don't call this function; it is for internal use only."
(if (integerp b) (< a b)
t)
(if (integerp b) t
;; string< also accepts symbols.
(string< a b))))))
(dolist (p list)
(funcall function (car p) (cdr p))))
@ -1219,7 +1220,8 @@ if it is empty or a duplicate."
Execution is delayed if `delay-mode-hooks' is non-nil.
If `delay-mode-hooks' is nil, run `after-change-major-mode-hook'
after running the mode hooks.
Major mode functions should use this."
Major mode functions should use this instead of `run-hooks' when running their
FOO-mode-hook."
(if delay-mode-hooks
;; Delaying case.
(dolist (hook hooks)
@ -2484,6 +2486,29 @@ If BODY finishes, `while-no-input' returns whatever value BODY produced."
(or (input-pending-p)
,@body))))))
(defmacro condition-case-no-debug (var bodyform &rest handlers)
"Like `condition-case' except that it does not catch anything when debugging.
More specifically if `debug-on-error' is set, then it does not catch any signal."
(declare (debug condition-case) (indent 2))
(let ((bodysym (make-symbol "body")))
`(let ((,bodysym (lambda () ,bodyform)))
(if debug-on-error
(funcall ,bodysym)
(condition-case ,var
(funcall ,bodysym)
,@handlers)))))
(defmacro with-demoted-errors (&rest body)
"Run BODY and demote any errors to simple messages.
If `debug-on-error' is non-nil, run BODY without catching its errors.
This is to be used around code which is not expected to signal an error
but which should be robust in the unexpected case that an error is signalled."
(declare (debug t) (indent 0))
(let ((err (make-symbol "err")))
`(condition-case-no-debug ,err
(progn ,@body)
(error (message "Error: %s" ,err) nil))))
(defmacro combine-after-change-calls (&rest body)
"Execute BODY, but don't call the after-change functions till the end.
If BODY makes changes in the buffer, they are recorded
@ -2518,6 +2543,20 @@ The value returned is the value of the last form in BODY."
;;;; Constructing completion tables.
(defun complete-with-action (action table string pred)
"Perform completion ACTION.
STRING is the string to complete.
TABLE is the completion table, which should not be a function.
PRED is a completion predicate.
ACTION can be one of nil, t or `lambda'."
;; (assert (not (functionp table)))
(funcall
(cond
((null action) 'try-completion)
((eq action t) 'all-completions)
(t 'test-completion))
string table pred))
(defmacro dynamic-completion-table (fun)
"Use function FUN as a dynamic completion table.
FUN is called with one argument, the string for which completion is required,
@ -2539,10 +2578,7 @@ that can be used as the ALIST argument to `try-completion' and
(with-current-buffer (let ((,win (minibuffer-selected-window)))
(if (window-live-p ,win) (window-buffer ,win)
(current-buffer)))
(cond
((eq ,mode t) (all-completions ,string (,fun ,string) ,predicate))
((not ,mode) (try-completion ,string (,fun ,string) ,predicate))
(t (test-completion ,string (,fun ,string) ,predicate)))))))
(complete-with-action ,mode (,fun ,string) ,string ,predicate)))))
(defmacro lazy-completion-table (var fun)
;; We used to have `&rest args' where `args' were evaluated late (at the
@ -2667,6 +2703,18 @@ of a match for REGEXP."
(looking-at (concat "\\(?:" regexp "\\)\\'")))))
(not (null pos))))
(defsubst looking-at-p (regexp)
"\
Same as `looking-at' except this function does not change the match data."
(let ((inhibit-changing-match-data t))
(looking-at regexp)))
(defsubst string-match-p (regexp string &optional start)
"\
Same as `string-match' except this function does not change the match data."
(let ((inhibit-changing-match-data t))
(string-match regexp string start)))
(defun subregexp-context-p (regexp pos &optional start)
"Return non-nil if POS is in a normal subregexp context in REGEXP.
A subregexp context is one where a sub-regexp can appear.

File diff suppressed because it is too large Load diff

View file

@ -243,6 +243,21 @@ Normally set to either `plain-tex-mode' or `latex-mode'."
:options '("''" "\">" "\"'" ">>" "»")
:group 'tex)
(defcustom tex-fontify-script t
"If non-nil, fontify subscript and superscript strings."
:type 'boolean
:group 'tex)
(put 'tex-fontify-script 'safe-local-variable 'booleanp)
(defcustom tex-font-script-display '(-0.3 . 0.3)
"Display specification for subscript and superscript content.
The car is used for subscript, the cdr is used for superscripts."
:group 'tex
:type '(cons (choice (float :tag "Subscript")
(const :tag "No lowering" nil))
(choice (float :tag "Superscript")
(const :tag "No raising" nil))))
(defvar tex-last-temp-file nil
"Latest temporary file generated by \\[tex-region] and \\[tex-buffer].
Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the
@ -593,13 +608,14 @@ An alternative value is \" . \", if you use a font with a narrow period."
(setq pos (1- pos) odd (not odd)))
odd))
(if (eq (char-after pos) ?_)
'(face subscript display (raise -0.3))
'(face superscript display (raise +0.3)))))
`(face subscript display (raise ,(car tex-font-script-display)))
`(face superscript display (raise ,(cdr tex-font-script-display))))))
(defun tex-font-lock-match-suscript (limit)
"Match subscript and superscript patterns up to LIMIT."
(when (re-search-forward "[_^] *\\([^\n\\{}]\\|\
\\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t)
(when (and tex-fontify-script
(re-search-forward "[_^] *\\([^\n\\{}]\\|\
\\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t))
(when (match-end 3)
(let ((beg (match-beginning 3))
(end (save-restriction

View file

@ -424,13 +424,6 @@ Return non-nil if FILE is unchanged."
;;; Completion of versions and revisions.
(defun vc-arch-complete (table string pred action)
(assert (not (functionp table)))
(cond
((null action) (try-completion string table pred))
((eq action t) (all-completions string table pred))
(t (test-completion string table pred))))
(defun vc-arch--version-completion-table (root string)
(delq nil
(mapcar
@ -450,10 +443,9 @@ Return non-nil if FILE is unchanged."
(lexical-let ((file file))
(lambda (string pred action)
;; FIXME: complete revision patches as well.
(let ((root (expand-file-name "{arch}" (vc-arch-root file))))
(vc-arch-complete
(vc-arch--version-completion-table root string)
string pred action)))))
(let* ((root (expand-file-name "{arch}" (vc-arch-root file)))
(table (vc-arch--version-completion-table root string)))
(complete-with-action action table string pred)))))
;;; Trimming revision libraries.

View file

@ -29,8 +29,11 @@
;;; Code:
(eval-when-compile
(require 'vc))
(eval-when-compile (require 'cl) (require 'vc))
;; Clear up the cache to force vc-call to check again and discover
;; new functions when we reload this file.
(put 'CVS 'vc-functions nil)
;;;
;;; Customization options
@ -368,99 +371,45 @@ its parents."
"-p"
(vc-switches 'CVS 'checkout)))
(defun vc-cvs-checkout (file &optional editable rev workfile)
"Retrieve a revision of FILE into a WORKFILE.
(defun vc-cvs-checkout (file &optional editable rev)
"Checkout a revision of FILE into the working area.
EDITABLE non-nil means that the file should be writable.
REV is the revision to check out into WORKFILE."
(let ((filename (or workfile file))
(file-buffer (get-file-buffer file))
switches)
(message "Checking out %s..." filename)
(save-excursion
;; Change buffers to get local value of vc-checkout-switches.
(if file-buffer (set-buffer file-buffer))
(setq switches (vc-switches 'CVS 'checkout))
;; Save this buffer's default-directory
;; and use save-excursion to make sure it is restored
;; in the same buffer it was saved in.
(let ((default-directory default-directory))
(save-excursion
;; Adjust the default-directory so that the check-out creates
;; the file in the right place.
(setq default-directory (file-name-directory filename))
(if workfile
(let ((failed t)
(backup-name (if (string= file workfile)
(car (find-backup-file-name filename)))))
(when backup-name
(copy-file filename backup-name
'ok-if-already-exists 'keep-date)
(unless (file-writable-p filename)
(set-file-modes filename
(logior (file-modes filename) 128))))
(unwind-protect
(progn
(let ((coding-system-for-read 'no-conversion)
(coding-system-for-write 'no-conversion))
(with-temp-file filename
(apply 'vc-cvs-command
(current-buffer) 0 file
"-Q" ; suppress diagnostic output
"update"
(and (stringp rev)
(not (string= rev ""))
(concat "-r" rev))
"-p"
switches)))
(setq failed nil))
(if failed
(if backup-name
(rename-file backup-name filename
'ok-if-already-exists)
(if (file-exists-p filename)
(delete-file filename)))
(and backup-name
(not vc-make-backup-files)
(delete-file backup-name)))))
(if (and (file-exists-p file) (not rev))
;; If no revision was specified, just make the file writable
;; if necessary (using `cvs-edit' if requested).
(and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
(if vc-cvs-use-edit
(vc-cvs-command nil 0 file "edit")
(set-file-modes file (logior (file-modes file) 128))
(if file-buffer (toggle-read-only -1))))
;; Check out a particular version (or recreate the file).
(vc-file-setprop file 'vc-workfile-version nil)
(apply 'vc-cvs-command nil 0 file
(and editable
(or (not (file-exists-p file))
(not (eq (vc-cvs-checkout-model file)
'implicit)))
"-w")
"update"
(when rev
(unless (eq rev t)
;; default for verbose checkout: clear the
;; sticky tag so that the actual update will
;; get the head of the trunk
(if (string= rev "")
"-A"
(concat "-r" rev))))
switches))))
(vc-mode-line file)
(message "Checking out %s...done" filename)))))
REV is the revision to check out."
(message "Checking out %s..." file)
;; Change buffers to get local value of vc-checkout-switches.
(with-current-buffer (or (get-file-buffer file) (current-buffer))
(if (and (file-exists-p file) (not rev))
;; If no revision was specified, just make the file writable
;; if necessary (using `cvs-edit' if requested).
(and editable (not (eq (vc-cvs-checkout-model file) 'implicit))
(if vc-cvs-use-edit
(vc-cvs-command nil 0 file "edit")
(set-file-modes file (logior (file-modes file) 128))
(if (equal file buffer-file-name) (toggle-read-only -1))))
;; Check out a particular version (or recreate the file).
(vc-file-setprop file 'vc-workfile-version nil)
(apply 'vc-cvs-command nil 0 file
(and editable "-w")
"update"
(when rev
(unless (eq rev t)
;; default for verbose checkout: clear the
;; sticky tag so that the actual update will
;; get the head of the trunk
(if (string= rev "")
"-A"
(concat "-r" rev))))
(vc-switches 'CVS 'checkout)))
(vc-mode-line file))
(message "Checking out %s...done" file))
(defun vc-cvs-delete-file (file)
(vc-cvs-command nil 0 file "remove" "-f")
(vc-cvs-command nil 0 file "commit" "-mRemoved."))
(defun vc-cvs-revert (file &optional contents-done)
"Revert FILE to the version it was based on."
(unless contents-done
;; Check out via standard output (caused by the final argument
;; FILE below), so that no sticky tag is set.
(vc-cvs-checkout file nil (vc-workfile-version file) file))
"Revert FILE to the version on which it was based."
(vc-default-revert 'CVS file contents-done)
(unless (eq (vc-checkout-model file) 'implicit)
(if vc-cvs-use-edit
(vc-cvs-command nil 0 file "unedit")
@ -588,14 +537,36 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
(and rev2 (concat "-r" rev2))
(vc-switches 'CVS 'diff))))))
(defconst vc-cvs-annotate-first-line-re "^[0-9]")
(defun vc-cvs-annotate-process-filter (process string)
(setq string (concat (process-get process 'output) string))
(if (not (string-match vc-cvs-annotate-first-line-re string))
;; Still waiting for the first real line.
(process-put process 'output string)
(let ((vc-filter (process-get process 'vc-filter)))
(set-process-filter process vc-filter)
(funcall vc-filter process (substring string (match-beginning 0))))))
(defun vc-cvs-annotate-command (file buffer &optional version)
"Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER.
Optional arg VERSION is a version to annotate from."
(vc-cvs-command buffer 0 file "annotate" (if version (concat "-r" version)))
(with-current-buffer buffer
(goto-char (point-min))
(re-search-forward "^[0-9]")
(delete-region (point-min) (1- (point)))))
(vc-cvs-command buffer
(if (and (vc-stay-local-p file) (fboundp 'start-process))
'async 0)
file "annotate"
(if version (concat "-r" version)))
;; Strip the leading few lines.
(let ((proc (get-buffer-process buffer)))
(if proc
;; If running asynchronously, use a process filter.
(progn
(process-put proc 'vc-filter (process-filter proc))
(set-process-filter proc 'vc-cvs-annotate-process-filter))
(with-current-buffer buffer
(goto-char (point-min))
(re-search-forward vc-cvs-annotate-first-line-re)
(delete-region (point-min) (1- (point)))))))
(defun vc-cvs-annotate-current-time ()
"Return the current time, based at midnight of the current day, and
@ -960,7 +931,34 @@ is non-nil."
(vc-file-setprop file 'vc-checkout-time 0)
(if set-state (vc-file-setprop file 'vc-state 'edited)))))))))
;; Completion of revision names.
;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use
;; `cvs log' so I can list all the revision numbers rather than only
;; tag names.
(defun vc-cvs-revision-table (file)
(let ((default-directory (file-name-directory file))
(res nil))
(with-temp-buffer
(vc-cvs-command t nil file "log")
(goto-char (point-min))
(when (re-search-forward "^symbolic names:\n" nil t)
(while (looking-at "^ \\(.*\\): \\(.*\\)")
(push (cons (match-string 1) (match-string 2)) res)
(forward-line 1)))
(while (re-search-forward "^revision \\([0-9.]+\\)" nil t)
(push (match-string 1) res))
res)))
(defun vc-cvs-revision-completion-table (file)
(lexical-let ((file file)
table)
(setq table (lazy-completion-table
table (lambda () (vc-cvs-revision-table file))))
table))
(provide 'vc-cvs)
;;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432
;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432
;;; vc-cvs.el ends here

View file

@ -62,9 +62,9 @@ interpreted as hostnames."
:type 'regexp
:group 'vc)
(defcustom vc-handled-backends '(RCS CVS SVN SCCS HG Arch MCVS)
(defcustom vc-handled-backends '(RCS CVS BZR SVN SCCS HG Arch MCVS)
;; Arch and MCVS come last because they are per-tree rather than per-dir.
"*List of version control backends for which VC will be used.
"List of version control backends for which VC will be used.
Entries in this list will be tried in order to determine whether a
file is under that sort of version control.
Removing an entry from the list prevents VC from being activated
@ -78,19 +78,19 @@ An empty list disables VC altogether."
(if (file-directory-p "/usr/sccs")
'("/usr/sccs")
nil)
"*List of extra directories to search for version control commands."
"List of extra directories to search for version control commands."
:type '(repeat directory)
:group 'vc)
(defcustom vc-make-backup-files nil
"*If non-nil, backups of registered files are made as with other files.
"If non-nil, backups of registered files are made as with other files.
If nil (the default), files covered by version control don't get backups."
:type 'boolean
:group 'vc
:group 'backup)
(defcustom vc-follow-symlinks 'ask
"*What to do if visiting a symbolic link to a file under version control.
"What to do if visiting a symbolic link to a file under version control.
Editing such a file through the link bypasses the version control system,
which is dangerous and probably not what you want.
@ -104,26 +104,26 @@ visited and a warning displayed."
:group 'vc)
(defcustom vc-display-status t
"*If non-nil, display revision number and lock status in modeline.
"If non-nil, display revision number and lock status in modeline.
Otherwise, not displayed."
:type 'boolean
:group 'vc)
(defcustom vc-consult-headers t
"*If non-nil, identify work files by searching for version headers."
"If non-nil, identify work files by searching for version headers."
:type 'boolean
:group 'vc)
(defcustom vc-keep-workfiles t
"*If non-nil, don't delete working files after registering changes.
"If non-nil, don't delete working files after registering changes.
If the back-end is CVS, workfiles are always kept, regardless of the
value of this flag."
:type 'boolean
:group 'vc)
(defcustom vc-mistrust-permissions nil
"*If non-nil, don't assume permissions/ownership track version-control status.
"If non-nil, don't assume permissions/ownership track version-control status.
If nil, do rely on the permissions.
See also variable `vc-consult-headers'."
:type 'boolean
@ -137,7 +137,7 @@ See also variable `vc-consult-headers'."
(vc-backend-subdirectory-name file)))))
(defcustom vc-stay-local t
"*Non-nil means use local operations when possible for remote repositories.
"Non-nil means use local operations when possible for remote repositories.
This avoids slow queries over the network and instead uses heuristics
and past information to determine the current status of a file.
@ -742,17 +742,27 @@ Format:
This function assumes that the file is registered."
(setq backend (symbol-name backend))
(let ((state (vc-state file))
(state-echo nil)
(rev (vc-workfile-version file)))
(cond ((or (eq state 'up-to-date)
(eq state 'needs-patch))
(concat backend "-" rev))
((stringp state)
(concat backend ":" state ":" rev))
(t
;; Not just for the 'edited state, but also a fallback
;; for all other states. Think about different symbols
;; for 'needs-patch and 'needs-merge.
(concat backend ":" rev)))))
(propertize
(cond ((or (eq state 'up-to-date)
(eq state 'needs-patch))
(setq state-echo "Up to date file")
(concat backend "-" rev))
((stringp state)
(setq state-echo (concat "File locked by" state))
(concat backend ":" state ":" rev))
(t
;; Not just for the 'edited state, but also a fallback
;; for all other states. Think about different symbols
;; for 'needs-patch and 'needs-merge.
(setq state-echo "Edited file")
(concat backend ":" rev)))
'mouse-face 'mode-line-highlight
'local-map (let ((map (make-sparse-keymap)))
(define-key map [mode-line down-mouse-1] 'vc-menu-map) map)
'help-echo (concat state-echo " under the " backend
" version control system\nmouse-1: VC Menu"))))
(defun vc-follow-link ()
"If current buffer visits a symbolic link, visit the real file.
@ -783,7 +793,7 @@ current, and kill the buffer that visits the link."
(when buffer-file-name
(vc-file-clearprops buffer-file-name)
(cond
((vc-backend buffer-file-name)
((with-demoted-errors (vc-backend buffer-file-name))
;; Compute the state and put it in the modeline.
(vc-mode-line buffer-file-name)
(unless vc-make-backup-files

View file

@ -149,14 +149,19 @@ You should set this to t when using a non-system shell.\n\n"))))
(if default-enable-multibyte-characters
'(undecided-dos . undecided-unix)
'(raw-text-dos . raw-text-unix)))
(or (w32-using-nt)
;; On Windows 9x, make cmdproxy default to using DOS line endings
;; for input, because command.com requires this.
(setq process-coding-system-alist
`(("[cC][mM][dD][pP][rR][oO][xX][yY]"
. ,(if default-enable-multibyte-characters
'(undecided-dos . undecided-dos)
'(raw-text-dos . raw-text-dos)))))))
;; Make cmdproxy default to using DOS line endings for input,
;; because some Windows programs (including command.com) require it.
(add-to-list 'process-coding-system-alist
`("[cC][mM][dD][pP][rR][oO][xX][yY]"
. ,(if default-enable-multibyte-characters
'(undecided-dos . undecided-dos)
'(raw-text-dos . raw-text-dos))))
;; plink needs DOS input when entering the password.
(add-to-list 'process-coding-system-alist
`("[pP][lL][iI][nN][kK]"
. ,(if default-enable-multibyte-characters
'(undecided-dos . undecided-dos)
'(raw-text-dos . raw-text-dos)))))
(add-hook 'before-init-hook 'set-default-process-coding-system)

View file

@ -645,10 +645,7 @@ header-line."
;; desired-height lines, constrained by MIN-HEIGHT and MAX-HEIGHT.
(- (max (min desired-height max-height)
(or min-height window-min-height))
window-height))
;; We do our own height checking, so avoid any restrictions due to
;; window-min-height.
(window-min-height 1))
window-height)))
;; Don't try to redisplay with the cursor at the end
;; on its own line--that would force a scroll and spoil things.

View file

@ -1,6 +1,23 @@
2007-07-14 Richard Stallman <rms@gnu.org>
* control.texi (Handling Errors): Document `debug' in handler list.
2007-07-10 Richard Stallman <rms@gnu.org>
* display.texi (Defining Faces): Explain C-M-x feature for defface.
2007-07-09 Richard Stallman <rms@gnu.org>
* files.texi (Magic File Names): Rewrite previous change.
2007-07-08 Michael Albinus <michael.albinus@gmx.de>
* files.texi (Magic File Names): Introduce optional parameter
CONNECTED for `file-remote-p'.
2007-07-07 Michael Albinus <michael.albinus@gmx.de>
* process.texi (Asynchronous Processes):
* processes.texi (Asynchronous Processes):
* files.texi (Magic File Names): Add `start-file-process'.
2007-06-27 Richard Stallman <rms@gnu.org>

View file

@ -893,6 +893,12 @@ establishing an error handler, with the special form
This deletes the file named @var{filename}, catching any error and
returning @code{nil} if an error occurs.
The @code{condition-case} construct is often used to trap errors that
are predictable, such as failure to open a file in a call to
@code{insert-file-contents}. It is also used to trap errors that are
totally unpredictable, such as when the program evaluates an expression
read from the user.
The second argument of @code{condition-case} is called the
@dfn{protected form}. (In the example above, the protected form is a
call to @code{delete-file}.) The error handlers go into effect when
@ -920,15 +926,33 @@ the two gets to handle it.
If an error is handled by some @code{condition-case} form, this
ordinarily prevents the debugger from being run, even if
@code{debug-on-error} says this error should invoke the debugger.
@xref{Error Debugging}. If you want to be able to debug errors that are
caught by a @code{condition-case}, set the variable
@code{debug-on-signal} to a non-@code{nil} value.
When an error is handled, control returns to the handler. Before this
happens, Emacs unbinds all variable bindings made by binding constructs
that are being exited and executes the cleanups of all
@code{unwind-protect} forms that are exited. Once control arrives at
the handler, the body of the handler is executed.
If you want to be able to debug errors that are caught by a
@code{condition-case}, set the variable @code{debug-on-signal} to a
non-@code{nil} value. You can also specify that a particular handler
should let the debugger run first, by writing @code{debug} among the
conditions, like this:
@example
@group
(condition-case nil
(delete-file filename)
((debug error) nil))
@end group
@end example
@noindent
The effect of @code{debug} here is only to prevent
@code{condition-case} from suppressing the call to the debugger. Any
given error will invoke the debugger only if @code{debug-on-error} and
the other usual filtering mechanisms say it should. @xref{Error Debugging}.
Once Emacs decides that a certain handler handles the error, it
returns control to that handler. To do so, Emacs unbinds all variable
bindings made by binding constructs that are being exited, and
executes the cleanups of all @code{unwind-protect} forms that are
being exited. Once control arrives at the handler, the body of the
handler executes normally.
After execution of the handler body, execution returns from the
@code{condition-case} form. Because the protected form is exited
@ -937,12 +961,6 @@ execution at the point of the error, nor can it examine variable
bindings that were made within the protected form. All it can do is
clean up and proceed.
The @code{condition-case} construct is often used to trap errors that
are predictable, such as failure to open a file in a call to
@code{insert-file-contents}. It is also used to trap errors that are
totally unpredictable, such as when the program evaluates an expression
read from the user.
Error signaling and handling have some resemblance to @code{throw} and
@code{catch} (@pxref{Catch and Throw}), but they are entirely separate
facilities. An error cannot be caught by a @code{catch}, and a
@ -960,7 +978,8 @@ error occurs during @var{protected-form}.
Each of the @var{handlers} is a list of the form @code{(@var{conditions}
@var{body}@dots{})}. Here @var{conditions} is an error condition name
to be handled, or a list of condition names; @var{body} is one or more
to be handled, or a list of condition names (which can include @code{debug}
to allow the debugger to run before the handler); @var{body} is one or more
Lisp expressions to be executed when this handler handles an error.
Here are examples of handlers:

View file

@ -1760,6 +1760,11 @@ When @code{defface} executes, it defines the face according to
@var{spec}, then uses any customizations that were read from the
init file (@pxref{Init File}) to override that specification.
When you evaluate a @code{defcustom} form with @kbd{C-M-x} in Emacs
Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun}
overrides any customizations of the face. This way, the face reflects
exactly what the @code{defcustom} says.
The purpose of @var{spec} is to specify how the face should appear on
different kinds of terminals. It should be an alist whose elements
have the form @code{(@var{display} @var{atts})}. Each element's

View file

@ -2768,7 +2768,7 @@ nothing and returns @code{nil}. Otherwise it returns the file name
of the local copy file.
@end defun
@defun file-remote-p filename
@defun file-remote-p filename &optional connected
This function tests whether @var{filename} is a remote file. If
@var{filename} is local (not remote), the return value is @code{nil}.
If @var{filename} is indeed remote, the return value is a string that
@ -2777,7 +2777,7 @@ identifies the remote system.
This identifier string can include a host name and a user name, as
well as characters designating the method used to access the remote
system. For example, the remote identifier string for the filename
@code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}.
@code{/sudo::/some/file} is @code{/sudo:root@@localhost:}.
If @code{file-remote-p} returns the same identifier for two different
filenames, that means they are stored on the same file system and can
@ -2785,6 +2785,11 @@ be accessed locally with respect to each other. This means, for
example, that it is possible to start a remote process accessing both
files at the same time. Implementors of file handlers need to ensure
this principle is valid.
If @var{connected} is non-@code{nil}, this function returns @code{nil}
even if @var{filename} is remote, if Emacs has no network connection
to its host. This is useful when you want to avoid the delay of
making connections when they don't exist.
@end defun
@defun unhandled-file-name-directory filename

View file

@ -1,7 +1,52 @@
2007-07-13 Eli Zaretskii <eliz@gnu.org>
* Makefile.in (../info/emacs-mime): Use --enable-encoding.
* makefile.w32-in ($(infodir)/emacs-mime): Ditto.
* emacs-mime.texi: Add @documentencoding directive.
2007-07-12 Nick Roberts <nickrob@snap.net.nz>
* tramp.texi (Remote processes): Add an anchor to the subsection
"Running a debugger on a remote host".
* building.texi (Starting GUD): Add xref to this anchor.
2007-07-12 Michael Albinus <michael.albinus@gmx.de>
* tramp.texi (Remote processes): Don't call it "experimental" any
longer. Add subsection about running a debugger on a remote host.
2007-07-10 Carsten Dominik <dominik@science.uva.nl>
* org.texi (Properties and columns): Chapter rewritten.
2007-07-08 Michael Albinus <michael.albinus@gmx.de>
* tramp.texi:
* trampver.texi: Migrate to Tramp 2.1.
2007-07-02 Carsten Dominik <dominik@science.uva.nl>
* org.texi (Properties): New chapter.
2007-07-02 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-faq.texi ([3.2]): Fix locating of environment variables in the
Control Panel.
* gnus.texi (Misc Article): Add index entry for
gnus-single-article-buffer.
2007-06-27 Andreas Seltenreich <andreas@gate450.dyndns.org>
* gnus.texi (Starting Up): Fix typo.
2007-06-25 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus.texi (Asynchronous Fetching): Fix typo.
2007-06-24 Karl Berry <karl@gnu.org>
* emacs.texi: new Back-Cover Text.

View file

@ -217,7 +217,7 @@ sieve.dvi: sieve.texi
$(ENVADD) $(TEXI2DVI) ${srcdir}/sieve.texi
../info/emacs-mime: emacs-mime.texi
cd $(srcdir); $(MAKEINFO) emacs-mime.texi
cd $(srcdir); $(MAKEINFO) --enable-encoding emacs-mime.texi
emacs-mime.dvi: emacs-mime.texi
$(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-mime.texi

View file

@ -527,6 +527,10 @@ debugger supports. However, shell wildcards and variables are not
allowed. GUD assumes that the first argument not starting with a
@samp{-} is the executable file name.
Tramp provides a facility to debug programs on remote hosts.
@xref{Running a debugger on a remote host, Running a debugger on a remote host,, tramp, The Tramp Manual}.
@c Running a debugger on a remote host
@node Debugger Operation
@subsection Debugger Operation

View file

@ -32,6 +32,9 @@ license to the document, as described in section 6 of the license.
@end quotation
@end copying
@c Node ``Interface Functions'' uses Latin-1 characters
@documentencoding ISO-8859-1
@dircategory Emacs
@direntry
* Emacs MIME: (emacs-mime). Emacs MIME de/composition library.

View file

@ -427,12 +427,11 @@ SET HOME=C:\myhome
@end example
@noindent
in your autoexec.bat and reboot. Under NT, 2000 and XP,
hit Winkey+Pause/Break to enter system options (if it
doesn't work, go to Control Panel -> System). There you'll
find the possibility to set environment variables, create
a new one with name HOME and value C:\myhome, a reboot is
not necessary.
in your autoexec.bat and reboot. Under NT, 2000 and XP, hit
Winkey+Pause/Break to enter system options (if it doesn't work, go to
Control Panel -> System -> Advanced). There you'll find the possibility
to set environment variables. Create a new one with name HOME and value
C:\myhome. Rebooting is not necessary.
Now to create ~/.gnus.el, say
@samp{C-x C-f ~/.gnus.el RET C-x C-s}.

View file

@ -947,8 +947,8 @@ Emacs for Heathens
@chapter Starting Gnus
@cindex starting up
If you are haven't used Emacs much before using Gnus, read @ref{Emacs
for Heathens} first.
If you haven't used Emacs much before using Gnus, read @ref{Emacs for
Heathens} first.
@kindex M-x gnus
@findex gnus
@ -7173,12 +7173,12 @@ pre-fetch all the articles it can without bound. If it is
@code{nil}, no pre-fetching will be done.
@vindex gnus-async-prefetch-article-p
@findex gnus-async-read-p
@findex gnus-async-unread-p
There are probably some articles that you don't want to pre-fetch---read
articles, for instance. The @code{gnus-async-prefetch-article-p}
variable controls whether an article is to be pre-fetched. This
function should return non-@code{nil} when the article in question is
to be pre-fetched. The default is @code{gnus-async-read-p}, which
to be pre-fetched. The default is @code{gnus-async-unread-p}, which
returns @code{nil} on read articles. The function is called with an
article data structure as the only parameter.
@ -11504,6 +11504,7 @@ region.
@item gnus-single-article-buffer
@vindex gnus-single-article-buffer
@cindex article buffers, several
If non-@code{nil}, use the same article buffer for all the groups.
(This is the default.) If @code{nil}, each group will have its own
article buffer.
@ -13509,14 +13510,18 @@ Header lines longer than the value of
@code{nnmail-split-header-length-limit} are excluded from the split
function.
@vindex nnmail-mail-splitting-charset
@vindex nnmail-mail-splitting-decodes
By default, splitting @acronym{MIME}-decodes headers so you
can match on non-@acronym{ASCII} strings. The
@code{nnmail-mail-splitting-charset} variable specifies the default
charset for decoding. The behavior can be turned off completely by
binding @code{nnmail-mail-splitting-decodes} to @code{nil}, which is
useful if you want to match articles based on the raw header data.
@vindex nnmail-mail-splitting-charset
By default, splitting does not decode headers, so you can not match on
non-@acronym{ASCII} strings. But it is useful if you want to match
articles based on the raw header data. To enable it, set the
@code{nnmail-mail-splitting-decodes} variable to a non-@code{nil} value.
In addition, the value of the @code{nnmail-mail-splitting-charset}
variable is used for decoding non-@acronym{MIME} encoded string when
@code{nnmail-mail-splitting-decodes} is non-@code{nil}. The default
value is @code{nil} which means not to decode non-@acronym{MIME} encoded
string. A suitable value for you will be @code{undecided} or be the
charset used normally in mails you are interested in.
@vindex nnmail-resplit-incoming
By default, splitting is performed on all incoming messages. If you

View file

@ -217,7 +217,7 @@ message.dvi: message.texi
$(ENVADD) $(TEXI2DVI) $(srcdir)/message.texi
#
$(infodir)/emacs-mime: emacs-mime.texi
$(MAKEINFO) emacs-mime.texi
$(MAKEINFO) --enable-encoding emacs-mime.texi
emacs-mime.dvi: emacs-mime.texi
$(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-mime.texi
#

View file

@ -3,7 +3,7 @@
@setfilename ../info/org
@settitle Org Mode Manual
@set VERSION 5.01
@set VERSION 5.03
@set DATE July 2007
@dircategory Emacs
@ -81,7 +81,7 @@ Software Foundation raise funds for GNU development.''
* Hyperlinks:: Notes in context
* TODO items:: Every tree branch can be a TODO item
* Tags:: Tagging headlines and matching sets of tags
* Properties::
* Properties and columns::
* Timestamps:: Assign date and time to items
* Agenda views:: Collecting information into views
* Embedded LaTeX:: LaTeX fragments and formulas
@ -113,7 +113,8 @@ Document Structure
* Archiving:: Move done task trees to a different place
* Sparse trees:: Matches embedded in context
* Plain lists:: Additional structure within an entry
* Drawers::
* Drawers:: Tucking stuff away
* orgstruct-mode:: Structure editing outside Org-mode
Archiving
@ -181,7 +182,7 @@ Tags
* Setting tags:: How to assign tags to a headline
* Tag searches:: Searching for combinations of tags
Properties
Properties and Columns
* Property syntax:: How properties are spelled out
* Special properties:: Access to other Org-mode features
@ -194,6 +195,11 @@ Column View
* Defining columns:: The COLUMNS format property
* Using column view:: How to create and use column view
Defining Columns
* Scope of column definitions::
* Column attributes::
Timestamps
* Time stamps:: Assigning a time to a tree entry
@ -379,7 +385,7 @@ tags etc are created dynamically when you need them.
Org-mode keeps simple things simple. When first fired up, it should
feel like a straightforward, easy to use outliner. Complexity is not
imposed, but a large amount of functionality is available when you need
it. Org-mode can be used on different levels and in different ways, for
it. Org-mode is a toolbox and can be used in different ways, for
example as:
@example
@ -389,6 +395,7 @@ example as:
@r{@bullet{} TODO list editor}
@r{@bullet{} full agenda and planner with deadlines and work scheduling}
@r{@bullet{} environment to implement David Allen's GTD system}
@r{@bullet{} a basic database application}
@r{@bullet{} simple hypertext system, with HTML export}
@r{@bullet{} publishing tool to create a set of interlinked webpages}
@end example
@ -396,7 +403,9 @@ example as:
Org-mode's automatic, context sensitive table editor with spreadsheet
capabilities can be integrated into any major mode by activating the
minor Orgtbl-mode. Using a translation step, it can be used to maintain
tables in arbitrary file types, for example in LaTeX.
tables in arbitrary file types, for example in LaTeX. The structure
editing and list creation capabilities can be used outside Org-mode with
the minor Orgstruct-mode.
@cindex FAQ
There is a website for Org-mode which provides links to the newest
@ -468,9 +477,10 @@ make install-info
@iftex
@b{Important:} @i{If you use copy-and-paste to copy lisp code from the
PDF documentation to your .emacs file, the single quote character comes
out incorrectly and the code will not work. You need to fix the single
quotes by hand, or copy from Info documentation.}
PDF documentation as viewed by Acrobat reader to your .emacs file, the
single quote character comes out incorrectly and the code will not work.
You need to fix the single quotes by hand, or copy from Info
documentation.}
@end iftex
Add the following lines to your @file{.emacs} file. The last two lines
@ -580,7 +590,8 @@ edit the structure of the document.
* Archiving:: Move done task trees to a different place
* Sparse trees:: Matches embedded in context
* Plain lists:: Additional structure within an entry
* Drawers::
* Drawers:: Tucking stuff away
* orgstruct-mode:: Structure editing outside Org-mode
@end menu
@node Outlines, Headlines, Document structure, Document structure
@ -605,8 +616,8 @@ key.
Headlines define the structure of an outline tree. The headlines in
Org-mode start with one or more stars, on the left margin@footnote{See
the variable @code{org-special-ctrl-a} to configure special behavior of
@kbd{C-a} in headlines.}. For example:
the variable @code{org-special-ctrl-a/e} to configure special behavior
of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
@example
* Top level headline
@ -1121,14 +1132,15 @@ bullets (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
With prefix arg, select the nth bullet from this list.
@end table
@node Drawers, , Plain lists, Document structure
@node Drawers, orgstruct-mode, Plain lists, Document structure
@section Drawers
@cindex drawers
@cindex visibility cycling, drawers
Sometimes you want to keep information associated with an entry, but you
normally don't want to see it, except when explicitly asking for it.
For this, Org-mode has @emph{drawers}. Drawers need to be configured
with the variable @code{org-drawers}, and look like this:
normally don't want to see it. For this, Org-mode has @emph{drawers}.
Drawers need to be configured with the variable @code{org-drawers}, and
look like this:
@example
** This is a headline
@ -1143,7 +1155,30 @@ Visibility cycling (@pxref{Visibility cycling}) on the headline will
hide and show the entry, but keep the drawer collapsed to a single line.
In order to look inside the drawer, you need to move the cursor to the
drawer line and press @key{TAB} there. Org-mode uses a drawer for
storing properties (@pxref{Properties}).
storing properties (@pxref{Properties and columns}).
@node orgstruct-mode, , Drawers, Document structure
@section The Orgstruct minor mode
@cindex orgstruct-mode
@cindex minor mode for structure editing
If you like the intuitive way the Org-mode structure editing and list
formatting works, you might want to use these commands in other modes
like text-mode or mail-mode as well. The minor mode Orgstruct-mode
makes this possible. You can always toggle the mode with @kbd{M-x
orgstruct-mode}. To turn it on by default, for example in mail mode,
use
@lisp
(add-hook 'mail-mode-hook 'turn-on-orgstruct)
@end lisp
When this mode is active and the cursor is on a line that looks to
Org-mode like a headline of the first line of a list item, most
structure editing commands will work, even if the same keys normally
have different functionality in the major mode you are using. If the
cursor is not in one of those special lines, Orgstruct-mode lurks
silently in the shadow.
@node Tables, Hyperlinks, Document structure, Top
@chapter Tables
@ -1611,15 +1646,15 @@ line like
@end example
@noindent
Also properties (@pxref{Properties}) can be used as constants in table
formulas: For a property @samp{:XYZ:} use the name @samp{$PROP_XYZ}, and
the property will be searched in the current outline entry and in the
hierarchy above it. If you have the @file{constants.el} package, it
will also be used to resolve constants, including natural constants like
@samp{$h} for Planck's constant, and units like @samp{$km} for
kilometers@footnote{@file{Constant.el} can supply the values of
constants in two different unit systems, @code{SI} and @code{cgs}.
Which one is used depends on the value of the variable
Also properties (@pxref{Properties and columns}) can be used as
constants in table formulas: For a property @samp{:XYZ:} use the name
@samp{$PROP_XYZ}, and the property will be searched in the current
outline entry and in the hierarchy above it. If you have the
@file{constants.el} package, it will also be used to resolve constants,
including natural constants like @samp{$h} for Planck's constant, and
units like @samp{$km} for kilometers@footnote{@file{Constant.el} can
supply the values of constants in two different unit systems, @code{SI}
and @code{cgs}. Which one is used depends on the value of the variable
@code{constants-unit-system}. You can use the @code{#+STARTUP} options
@code{constSI} and @code{constcgs} to set this value for the current
buffer.}. Column names and parameters can be specified in special table
@ -2998,7 +3033,8 @@ percentage of checkboxes checked (in the above example, this would be
@table @kbd
@kindex C-c C-c
@item C-c C-c
Toggle checkbox at point.
Toggle checkbox at point. With prefix argument, set it to @samp{[-]},
which is considered to be an intermediate state.
@kindex C-c C-x C-b
@item C-c C-x C-b
Toggle checkbox at point.
@ -3030,7 +3066,7 @@ back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
@end table
@node Tags, Properties, TODO items, Top
@node Tags, Properties and columns, TODO items, Top
@chapter Tags
@cindex tags
@cindex headline tagging
@ -3286,8 +3322,8 @@ instead of any TAG an expression like @samp{LEVEL=3}. For example, a
search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
@node Properties, Timestamps, Tags, Top
@chapter Properties
@node Properties and columns, Timestamps, Tags, Top
@chapter Properties and Columns
@cindex properties
Properties are a set of key-value pairs associated with an entry. There
@ -3298,7 +3334,8 @@ tags like @code{:release_1:}, @code{:release_2:}, it can be more
efficient to use a property @code{RELEASE} with a value @code{1.0} or
@code{2.0}. Second, you can use properties to implement (very basic)
database capabilities in an Org-mode buffer, for example to create a
list of Music CD's you own.
list of Music CD's you own. You can edit and view properties
conveniently in column view (@pxref{Column view}).
@menu
* Property syntax:: How properties are spelled out
@ -3308,8 +3345,10 @@ list of Music CD's you own.
* Property API:: Properties for Lisp programmers
@end menu
@node Property syntax, Special properties, Properties, Properties
@node Property syntax, Special properties, Properties and columns, Properties and columns
@section Property Syntax
@cindex property syntax
@cindex drawer, for properties
Properties are key-value pairs. They need to be inserted into a special
drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
@ -3324,26 +3363,65 @@ first, and the value after it. Here is an example:
:Title: Goldberg Variations
:Composer: J.S. Bach
:Artist: Glen Gould
:END:
:Publisher: Deutsche Grammphon
:NDisks: 1
:END:
@end example
You may define the allowed values for a particular property @samp{XYZ}
by setting a property @samp{XYZ_ALL}. This special property is
@emph{inherited}, so if you set it in a level 1 entry, it will apply to
the entire tree. When allowed values are defined, setting the
corresponding property becomes easier and is less prone to typing
errors. For the example with the CD collection, we can predefine
publishers and the number of disks in a box like this:
@example
* CD collection
:PROPERTIES:
:NDisks_ALL: 1 2 3 4
:Publisher_ALL: "Deutsche Grammophon" Phillips EMI
:END:
@end example
@noindent
The following commands help to insert properties:
The following commands help to work with properties:
@table @kbd
@kindex M-@key{TAB}
@item M-@key{TAB}
After an initial colon in a line, complete property keys. All keys used
in the current file will be offered as possible completions.
@item M-x org-insert-property-drawer
Insert a property drawer into the current entry. The drawer will be
inserted early in the entry, but after the lines with planning
information like deadlines.
@kindex C-c C-c
@item C-c C-c
With the cursor in a property drawer, this executes property commands.
@item C-c C-c s
Set a property in the current entry. Both the property and the value
can be inserted using completion.
@kindex S-@key{right}
@kindex S-@key{left}
@item S-@key{left}/@key{right}
Switch property at point to the next/previous allowed value.
@item C-c C-c d
Remove a property from the current entry.
@item C-c C-c D
Globally remove a property, from all entries in the current file.
@end table
@node Special properties, Property searches, Property syntax, Properties
@node Special properties, Property searches, Property syntax, Properties and columns
@section Special Properties
@cindex properties, special
Several properties are special, because they can be used to access other
features of Org-mode like the TODO status:
Special properties provide alternative access method to Org-mode
features discussed in the previous chapters, like the TODO state or the
priority of an entry. This interface exists so that you can include
these states into columns view (@pxref{Column view}). The following
property names are special and should not be used as keys in the
properties drawer:
@example
TODO @r{The TODO keyword of the entry.}
@ -3354,8 +3432,9 @@ DEADLINE @r{The deadline time string, without the angular brackets.}
SCHEDULED @r{The scheduling time stamp, without the angular brackets.}
@end example
@node Property searches, Column view, Special properties, Properties
@node Property searches, Column view, Special properties, Properties and columns
@section Property searches
@cindex properties, searching
To create sparse trees and special lists with selection based on
properties, the same commands are used as for tag searches (@pxref{Tag
@ -3371,23 +3450,22 @@ also have a priority value @samp{A}, a @samp{:coffee:} property with the
value @samp{unlimited}, and a @samp{:with:} property that is matched by
the regular expression @samp{Sarah\|Denny}.
@node Column view, Property API, Property searches, Properties
@node Column view, Property API, Property searches, Properties and columns
@section Column View
If different items in a document have similar properties, it can be nice
to view and edit those properties in a table-like format, in
@emph{column view}. Org-mode implements columns by overlaying a tabular
structure over the headline of an item. So the column view does not use
a special buffer, it happens in exactly the same buffer where the
outline is, and only temporarily changes the look of this buffer - not
the content. This has the advantage that you can still change the
visibility of the outline tree. For example, you get a compact table by
switching to CONTENTS view, but you can still open, read, and edit the
entry below each headline. Or, you can switch to column view after
executing a sparse tree command and in this way get a table only for the
selected items. Column view also works in agenda buffers (@pxref{Agenda
views}) where queries have collected selected items, possibly from a
number of files.
A great way to view and edit properties in an outline tree is
@emph{column view}. In column view, each outline item is turned into a
table row. Columns in this table provide access to properties of the
entries. Org-mode implements columns by overlaying a tabular structure
over the headline of each item. While the headlines have been turned
into a table row, you can still change the visibility of the outline
tree. For example, you get a compact table by switching to CONTENTS
view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
is active), but you can still open, read, and edit the entry below each
headline. Or, you can switch to column view after executing a sparse
tree command and in this way get a table only for the selected items.
Column view also works in agenda buffers (@pxref{Agenda views}) where
queries have collected selected items, possibly from a number of files.
@menu
* Defining columns:: The COLUMNS format property
@ -3396,81 +3474,122 @@ number of files.
@node Defining columns, Using column view, Column view, Column view
@subsection Defining Columns
@cindex column view, for properties
@cindex properties, column view
Setting up a column view first requires defining the columns. A column
definition is a property itself and looks like this:
Setting up a column view first requires defining the columns. This is
done by defining a column format line.
@menu
* Scope of column definitions:: Where defined, where valid?
* Column attributes:: Appearance and content of a column
@end menu
@node Scope of column definitions, Column attributes, Defining columns, Defining columns
@subsubsection Scope of column definitions
To define a column format for an entire file, use a line like
@example
:COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
#+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
@end example
This definition means that column 1 should be the first 25 characters of
the item itself, i.e. of the headline. You probably always should start
the column definition with the ITEM specifier - just select a useful
width for it. The other specifiers create columns for the local tags,
for the priority and for the TODO state. When no width is given after
the @samp{%} character, the column will be exactly as wide as it need to
be in order to fully display all values.
If a @code{COLUMNS} property is present in an entry, it defines
columns for the entry itself, and for the entire subtree below it.
Since the column definition is part of the hierarchical structure of the
document, you can define columns on level 1 that are general enough for
all sublevels, and more specific columns further down, when you edit a deeper
part of the tree. Here is an example:
To specify a format that only applies to a specific tree, add a COLUMNS
property to the top node of that tree, for example
@example
* People
:PROPERTIES:
:COLUMNS: %25ITEM %Name
:END:
** Family
** Top node for columns view
:PROPERTIES:
:COLUMNS: %25ITEM %Name %3Age
:COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
:END:
*** Sam
Info about Sam, including a property list with Name and Age.
*** Sarah
Info about Sarah, including a property list with Name and Age.
** Office
:PROPERTIES:
:COLUMNS: %25ITEM %Name %Function %Salary
:END:
*** Boss
Info about the Boss, including a property list with Name,
Function and Salary (if only we knew....).
@end example
Now we have defined three different sets of columns. If you switch to
column view in the @emph{Family} section, you will get a different table
than if you do it in the @emph{Office} section. However, if you switch
to column view with the cursor on the @emph{People} section, the table
will cover all entries, but contain only the @emph{Name} column.
If a @code{COLUMNS} property is present in an entry, it defines columns
for the entry itself, and for the entire subtree below it. Since the
column definition is part of the hierarchical structure of the document,
you can define columns on level 1 that are general enough for all
sublevels, and more specific columns further down, when you edit a
deeper part of the tree.
If no COLUMNS property applies to a given location, Org-mode uses a
default format specified in the variable
@code{org-default-columns-format}. This format in particular also
applies when column view is invoked with the cursor before the first
headline. You can set the default format on a per-file basis with a
line (don't forget to press @kbd{C-c C-c} to activate any changes to
this line).
@node Column attributes, , Scope of column definitions, Defining columns
@subsubsection Column attributes
A column definition sets the attributes of a column. The general
definition looks like this:
@example
#+COLUMNS: %25ITEM ....."
%[width]property[(title)][@{summary-type@}]
@end example
@noindent
Except for the percent sign and the property name, all items are
optional. The individual parts have the following meaning:
@example
width @r{An integer specifying the width of the column in characters.}
@r{If omitted, the width will be determined automatically.}
property @r{The property that should be edited in this column.}
(title) @r{The header text for the column. If omitted, the}
@r{property name is used.}
@{summary-type@} @r{The summary type. If specified, the column values for}
@r{parent nodes are computed from the children.}
@r{Supported summary types are:}
@{+@} @r{Sum numbers in this column.}
@{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
@{X@} @r{Checkbox status, [X] if all children are [X].}
@end example
@noindent
Here is an example for a complete columns definition, along with allowed
values.
@example
:COLUMNS: %20ITEM %9Approved(Approved?)@{X@} %Owner %11Status %10Time_Spent@{:@}
:Owner_ALL: Tammy Mark Karl Lisa Don
:Status_ALL: "In progress" "Not started yet" "Finished" ""
:Approved_ALL: "[ ]" "[X]"
@end example
The first column, @samp{%25ITEM}, means the first 25 characters of the
item itself, i.e. of the headline. You probably always should start the
column definition with the ITEM specifier. The other specifiers create
columns @samp{Owner} with a list of names as allowed values, for
@samp{Status} with four different possible values, and for a checkbox
field @samp{Approved}. When no width is given after the @samp{%}
character, the column will be exactly as wide as it needs to be in order
to fully display all values. The @samp{Approved} column does have a
modified title (@samp{Approved?}, with a question mark). Summaries will
be created for the @samp{Time_Spent} column by adding time duration
expressions like HH:MM, and for the @samp{Approved} column, by providing
an @samp{[X]} status if all children have been checked.
@node Using column view, , Defining columns, Column view
@subsection Using Column View
@table @kbd
@tsubheading{Turning column view on and off}
@kindex C-c C-x C-c
@item C-c C-x C-c
Create the column view for the local environment. This command searches
the hierarchy, up from point, for a @code{COLUMNS} property that defines
a format. When one is found, the column view table is established for
the entire subtree.
the entire tree, starting from the entry that contains the @code{COLUMNS}
property. If none is found, the format is taken from the @code{#+COLUMNS}
line or from the variable @code{org-columns-default-format}, and column
view is established for the current entry and its subtree.
@kindex q
@item q
Exit column view.
@tsubheading{Editing values}
@item @key{left} @key{right} @key{up} @key{down}
Move through the column view from field to field.
@kindex S-@key{left}
@kindex S-@key{right}
@item S-@key{left}/@key{right}
Switch to the next/previous allowed value of the field. For this, you
have to have specified allowed values for a property.
@kindex n
@kindex p
@itemx n / p
Same as @kbd{S-@key{left}/@key{right}}
@kindex e
@item e
Edit the property at point. For the special properties, this will
@ -3481,20 +3600,36 @@ or fast selection interface will pop up.
@item v
View the full value of this property. This is useful if the width of
the column is smaller than that of the value.
@kindex q
@item q
Exit column view.
@kindex a
@item a
Edit the list of allowed values for this property. If the list is found
in the hierarchy, the modified values is stored there. If no list is
found, the new value is stored in the first entry that is part of the
current column view.
@tsubheading{Modifying the table structure}
@kindex <
@kindex >
@item < / >
Make the column narrower/wider by one character.
@kindex S-M-@key{right}
@item S-M-@key{right}
Insert a new column, to the right of the current column.
@kindex S-M-@key{left}
@item S-M-@key{left}
Delete the current column.
@end table
@node Property API, , Column view, Properties
@node Property API, , Column view, Properties and columns
@section The Property API
@cindex properties, API
@cindex API, for properties
There is a full API for accessing and changing properties. This API can
be used by Emacs Lisp programs to work with properties and to implement
features based on them. For more information see @ref{Using the
property API}.
@node Timestamps, Agenda views, Properties, Top
@node Timestamps, Agenda views, Properties and columns, Top
@chapter Timestamps
@cindex time stamps
@cindex date stamps
@ -4355,7 +4490,7 @@ file in a @emph{time-sorted view}. The main purpose of this command is
to give an overview over events in a project.
@table @kbd
@kindex C-a a L
@kindex C-c a L
@item C-c a L
Show a time-sorted view of the org file, with all time-stamped items.
When called with a @kbd{C-u} prefix, all unfinished TODO entries
@ -4604,7 +4739,9 @@ Delete other windows.
@kindex m
@kindex y
@item d w m y
Switch to day/week/month/year view.
Switch to day/week/month/year view. When switching to day or week view,
this setting becomes the default for subseqent agenda commands. Since
month and year views are slow to create, the do not become the default.
@c
@kindex D
@item D
@ -5947,16 +6084,15 @@ skip: @r{turn on/off skipping the text before the first heading}
@chapter Publishing
@cindex publishing
Org-mode includes@footnote{@file{org-publish.el} is not yet part of
Emacs, so if you are using @file{org.el} as it comes with Emacs, you
need to download this file separately. Also make sure org.el is at
least version 4.27.} a publishing management system
that allows you to configure automatic HTML conversion of
@emph{projects} composed of interlinked org files. This system is
called @emph{org-publish}. You can also configure org-publish to
automatically upload your exported HTML pages and related attachments,
such as images and source code files, to a web server. Org-publish turns
org-mode into a web-site authoring tool.
Org-mode includes@footnote{@file{org-publish.el} is not distributed with
Emacs 21, if you are still using Emacs 21, you need you need to download
this file separately.} a publishing management system that allows you to
configure automatic HTML conversion of @emph{projects} composed of
interlinked org files. This system is called @emph{org-publish}. You
can also configure org-publish to automatically upload your exported
HTML pages and related attachments, such as images and source code
files, to a web server. Org-publish turns org-mode into a web-site
authoring tool.
Org-publish has been contributed to Org-mode by David O'Toole.
@ -6118,7 +6254,7 @@ respective variable for details.
When a property is given a value in org-publish-project-alist, its
setting overrides the value of the corresponding user variable (if any)
during publishing. options set within a file (@pxref{Export
during publishing. Options set within a file (@pxref{Export
options}), however, override everything.
@node Publishing links, Project page index, Publishing options, Configuration
@ -6445,8 +6581,8 @@ Logging TODO state changes and clock intervals (variable
logging @r{record a timestamp when an item is marked DONE}
nologging @r{don't record when items are marked DONE}
lognotedone @r{record timestamp and a note when DONE}
lognotestate @r{record timestamp, note when TODO state changes}
logrepeat @r{record a not when re-instating a repeating item}
lognotestate @r{record timestamp and a note when TODO state changes}
logrepeat @r{record a note when re-instating a repeating item}
nologrepeat @r{do not record when re-instating repeating item}
lognoteclock-out @r{record timestamp and a note when clocking out}
@end example
@ -6531,6 +6667,9 @@ default location.
If the cursor is on a @code{<<<target>>>}, update radio targets and
corresponding links in this buffer.
@item
If the cursor is in a property line or at the start or end of a property
drawer, offer property commands.
@item
If the cursor is in a plain list item with a checkbox, toggle the status
of the checkbox.
@item
@ -7289,6 +7428,7 @@ MATCH is being ignored."
@node Using the property API, , Special agenda views, Extensions and Hacking
@section Using the property API
@cindex API, for properties
@cindex properties, API
Here is a description of the functions that can be used to work with
properties.

View file

@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2007-06-16.10}
\def\texinfoversion{2007-07-09.21}
%
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@ -7434,22 +7434,41 @@
% @documentlanguage is usually given very early, just after
% @setfilename. If done too late, it may not override everything
% properly. Single argument is the language abbreviation.
% It would be nice if we could set up a hyphenation file here.
% properly. Single argument is the language (de) or locale (de_DE)
% abbreviation. It would be nice if we could set up a hyphenation file.
%
\parseargdef\documentlanguage{%
{
\catcode`\_ = \active
\globaldefs=1
\parseargdef\documentlanguage{\begingroup
\let_=\normalunderscore % normal _ character for filenames
\tex % read txi-??.tex file in plain TeX.
% Read the file if it exists.
% Read the file by the name they passed if it exists.
\openin 1 txi-#1.tex
\ifeof 1
\errhelp = \nolanghelp
\errmessage{Cannot read language file txi-#1.tex}%
\documentlanguagetrywithoutunderscore{#1_\finish}%
\else
\input txi-#1.tex
\fi
\closein 1
\endgroup
\endgroup}
}
%
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
% try txi-de.tex.
%
\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
\openin 1 txi-#1.tex
\ifeof 1
\errhelp = \nolanghelp
\errmessage{Cannot read language file txi-#1.tex}%
\else
\input txi-#1.tex
\fi
\closein 1
}
%
\newhelp\nolanghelp{The given language definition file cannot be found or
is empty. Maybe you need to install it? In the current directory
should work if nowhere else does.}
@ -8316,6 +8335,8 @@
\ifpdf
\pdfpageheight #7\relax
\pdfpagewidth #8\relax
\pdfhorigin = 1 true in
\pdfvorigin = 1 true in
\fi
%
\setleading{\textleading}

File diff suppressed because it is too large Load diff

View file

@ -1,27 +1,26 @@
@c -*-texinfo-*-
@c texi/trampver.texi. Generated from trampver.texi.in by configure.
@c This is part of the Emacs manual.
@c Copyright (C) 2003, 2004, 2005, 2006, 2007
@c Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@c In the Tramp CVS, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number.
@set trampver 2.0.56
@set trampver 2.1.10-pre
@c Other flags from configuration
@set prefix /usr/local
@set instprefix /usr/local
@set lispdir /usr/local/share/emacs/site-lisp
@set infodir /usr/local/share/info
@set infodir /usr/local/info
@c Formatting of the tramp program name consistent.
@set tramp @sc{tramp}
@c Whether or not describe gateway methods.
@ifclear noemacsgw
@set emacsgw
@end ifclear
@c Some flags which make the text independent on the (X)Emacs flavor.
@c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs".
@ifclear emacs
@ifclear xemacs
@set emacs
@ -34,10 +33,9 @@
@set emacsdir emacs
@set ftppackagename Ange-FTP
@set prefix /
@set prefixsinglehop
@set prefixhop
@set postfix :
@set postfixsinglehop :
@set postfixmultihop :
@set postfixhop :
@set emacsothername XEmacs
@set emacsotherdir xemacs
@set emacsotherfilename tramp-xemacs.html
@ -50,10 +48,9 @@
@set emacsdir xemacs
@set ftppackagename EFS
@set prefix /[
@set prefixsinglehop [
@set prefixhop [
@set postfix ]
@set postfixsinglehop /
@set postfixmultihop :
@set postfixhop /
@set emacsothername GNU Emacs
@set emacsotherdir emacs
@set emacsotherfilename tramp-emacs.html

View file

@ -1,3 +1,14 @@
2007-07-14 Jason Rumney <jasonr@gnu.org>
* inc/sys/socket.h: Include winsock2.h and ws2tcpip.h instead
of winsock.h.
2007-07-11 Jason Rumney <jasonr@gnu.org>
* gmake.defs (OLE32): New library to link.
* nmake.defs (OLE32): Likewise.
2007-06-25 Jason Rumney <jasonr@gnu.org>
* cmdproxy.c (main): Set console codepages to "ANSI".

View file

@ -176,8 +176,9 @@ MPR = -lmpr
SHELL32 = -lshell32
USER32 = -luser32
WSOCK32 = -lwsock32
WINMM = -lwinmm
WINMM = -lwinmm
WINSPOOL = -lwinspool
OLE32 = -lole32
ifdef NOOPT
DEBUG_CFLAGS = -DEMACSDEBUG

View file

@ -51,7 +51,8 @@ Boston, MA 02110-1301, USA. */
#define timeval ws_timeval
#endif
#include <winsock.h>
#include <winsock2.h>
#include <ws2tcpip.h>
/* redefine select to reference our version */
#ifdef MUST_REDEF_SELECT

View file

@ -123,8 +123,9 @@ MPR = mpr.lib
SHELL32 = shell32.lib
USER32 = user32.lib
WSOCK32 = wsock32.lib
WINMM = winmm.lib
WINMM = winmm.lib
WINSPOOL = winspool.lib
OLE32 = ole32.lib
!ifdef NOOPT
DEBUG_CFLAGS = -DEMACSDEBUG

View file

@ -1,3 +1,98 @@
2007-07-14 Jason Rumney <jasonr@gnu.org>
* process.c [WINDOWSNT]: Don't undefine AF_INET6.
2007-07-14 Richard Stallman <rms@gnu.org>
* eval.c (maybe_call_debugger): New function.
(find_handler_clause): Use maybe_call_debugger.
Call it when the handler says `debug'.
Eliminate DEBUGGER_VALUE_PTR.
(Fsignal): Eliminate debugger_value.
(Qdebug): New variable.
(syms_of_eval): Initialize it.
2007-07-14 Juanma Barranquero <lekktu@gmail.com>
* eval.c (Fprogn):
* keyboard.c (Ftrack_mouse):
* print.c (Fwith_output_to_temp_buffer):
* window.c (Fsave_window_excursion): Doc fix.
2007-07-13 Stefan Monnier <monnier@iro.umontreal.ca>
* eval.c (init_eval_once): Bump max_lisp_eval_depth to 400.
2007-07-12 Stefan Monnier <monnier@iro.umontreal.ca>
* process.h (struct Lisp_Process): Turn slots infd, outfd,
kill_without_query, pty_flag, tick, update_tick, decoding_carryover,
inherit_coding_system_flag, filter_multibyte, adaptive_read_buffering,
read_output_delay, and read_output_skip from Lisp_Objects to ints.
Remove unused encoding_carryover.
* process.c: Adjust all functions accordingly.
2007-07-12 Richard Stallman <rms@gnu.org>
* term.c: Include unistd.h only if HAVE_UNISTD_H.
2007-07-11 Jason Rumney <jasonr@gnu.org>
* makefile.w32-in (LIBS): Include OLE32.
* w32fns.c (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
(w32_msg_pump) <WM_DESTROY>: Uninitialize COM.
2007-07-11 Stefan Monnier <monnier@iro.umontreal.ca>
* lisp.h (struct Lisp_Hash_Table): Turn next_weak into a bare pointer.
* fns.c (weak_hash_tables): Rename from Vweak_hash_tables and turned
from a Lisp_Object into a bare pointer.
(make_hash_table, copy_hash_table, sweep_weak_hash_tables, init_fns):
Adjust the code correspondingly.
* alloc.c (emacs_blocked_free): Remove unused var `bytes_used_now'.
* term.c: Include unistd.h for ttyname, used in handle_one_term_event.
(term_show_mouse_face): Remove unused var `j'.
(handle_one_term_event): Remove unused vars `i' and `j'.
Don't cast return value of ttyname since it's not necessary.
2007-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
* alloc.c (mark_maybe_pointer): Enforce mult-of-8 alignment when using
USE_LSB_TAG. Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
* fns.c (map_char_table): Use an array of int for `indices' rather than
an array of Lisp_Objects (which are only ever integers anyway).
(Fmap_char_table): Update caller.
* lisp.h: Update prototype.
* keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap):
* fontset.c (Ffontset_info):
* casetab.c (set_case_table): Update callers.
* editfns.c (Ftranspose_regions): Use EMACS_INT for positions.
* keymap.c (struct accessible_keymaps_data)
(struct where_is_internal_data): New structures.
(accessible_keymaps_1, where_is_internal_1): Use them to change
interface to adhere to the one used by map_keymap.
(Faccessible_keymaps, where_is_internal): Use map_keymap.
(accessible_keymaps_char_table, where_is_internal_2): Remove.
* keymap.h (map_keymap_function_t): More informative prototype.
2007-07-10 Guanpeng Xu <herberteuler@hotmail.com>
* search.c (Vinhibit_changing_match_data, search_regs_1): New vars.
(looking_at_1): Don't change search_regs and last_thing_searched
if `inhibit-changing-match-data' is non-nil.
(string_match_1, search_buffer, set_search_regs): Likewise.
(syms_of_search): Add Lisp level definition for
`inhibit-changing-match-data' and set it to nil.
(boyer_moore): If `inhibit-changing-match-data' is non-nil, compute
start and end of the match, instead of using values in search_regs.
2007-07-01 Stefan Monnier <monnier@iro.umontreal.ca>
* minibuf.c (Fcompleting_read): New value `confirm-only'
@ -1118,13 +1213,13 @@
when popup menu finishes.
* w32fns.c (menubar_in_use): New flag.
(w32_wnd_proc) [WM_INITMENU, WM_EXITMENULOOP, WM_TIMER, WM_COMMAND]:
(w32_wnd_proc) <WM_INITMENU, WM_EXITMENULOOP, WM_TIMER, WM_COMMAND>:
Use it.
* w32menu.c (Fx_popup_menu): Don't free menu strings here.
(w32_menu_show): Do it here instead.
* w32fns.c (w32_wnd_proc) [WM_INITMENU]: Set menubar_active frame
* w32fns.c (w32_wnd_proc) <WM_INITMENU>: Set menubar_active frame
parameter.
* w32menu.c (current_popup_menu): Make available globally.
@ -1132,7 +1227,7 @@
menu event into the keyboard buffer. Remove menu_command_in_progress.
* w32fns.c (current_popup_menu): Use from w32menu.c.
(w32_wnd_proc) [WM_EXITMENULOOP, WM_TIMER]: Use menubar_active
(w32_wnd_proc) <WM_EXITMENULOOP, WM_TIMER>: Use menubar_active
and current_popup_menu to determine whether a menubar menu has
been cancelled.
@ -10243,7 +10338,7 @@
* w32term.h (x_output): Add focus_state.
* w32term.c (x_focus_changed, w32_detect_focus_change): New functions.
(w32_read_socket) [WM_SETFOCUS]: Call w32_detect_focus_change.
(w32_read_socket) <WM_SETFOCUS>: Call w32_detect_focus_change.
2005-03-25 Stefan Monnier <monnier@iro.umontreal.ca>
@ -13531,7 +13626,7 @@
* w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c.
* w32fns.c (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]:
* w32fns.c (w32_wnd_proc) <WM_MEASUREITEM, WM_DRAWITEM>:
Handle Unicode menu titles.
2004-09-07 Kim F. Storm <storm@cua.dk>

View file

@ -1179,8 +1179,6 @@ emacs_blocked_free (ptr, ptr2)
void *ptr;
const void *ptr2;
{
EMACS_INT bytes_used_now;
BLOCK_INPUT_ALLOC;
#ifdef GC_MALLOC_CHECK
@ -4220,9 +4218,14 @@ mark_maybe_pointer (p)
{
struct mem_node *m;
/* Quickly rule out some values which can't point to Lisp data. We
assume that Lisp data is aligned on even addresses. */
if ((EMACS_INT) p & 1)
/* Quickly rule out some values which can't point to Lisp data. */
if ((EMACS_INT) p %
#ifdef USE_LSB_TAG
8 /* USE_LSB_TAG needs Lisp data to be aligned on multiples of 8. */
#else
2 /* We assume that Lisp data is aligned on even addresses. */
#endif
)
return;
m = mem_find (p);

View file

@ -4256,9 +4256,9 @@ Transposing beyond buffer boundaries is an error. */)
(startr1, endr1, startr2, endr2, leave_markers)
Lisp_Object startr1, endr1, startr2, endr2, leave_markers;
{
register int start1, end1, start2, end2;
int start1_byte, start2_byte, len1_byte, len2_byte;
int gap, len1, len_mid, len2;
register EMACS_INT start1, end1, start2, end2;
EMACS_INT start1_byte, start2_byte, len1_byte, len2_byte;
EMACS_INT gap, len1, len_mid, len2;
unsigned char *start1_addr, *start2_addr, *temp;
INTERVAL cur_intv, tmp_interval1, tmp_interval_mid, tmp_interval2, tmp_interval3;

View file

@ -97,6 +97,7 @@ Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag;
Lisp_Object Qand_rest, Qand_optional;
Lisp_Object Qdebug_on_error;
Lisp_Object Qdeclare;
Lisp_Object Qdebug;
/* This holds either the symbol `run-hooks' or nil.
It is nil at an early stage of startup, and when Emacs
@ -220,7 +221,7 @@ init_eval_once ()
specpdl_ptr = specpdl;
/* Don't forget to update docs (lispref node "Local Variables"). */
max_specpdl_size = 1000;
max_lisp_eval_depth = 300;
max_lisp_eval_depth = 400;
Vrun_hooks = Qnil;
}
@ -433,7 +434,7 @@ usage: (cond CLAUSES...) */)
DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0,
doc: /* Eval BODY forms sequentially and return value of last one.
usage: (progn BODY ...) */)
usage: (progn BODY...) */)
(args)
Lisp_Object args;
{
@ -1585,8 +1586,7 @@ internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
static Lisp_Object find_handler_clause P_ ((Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object,
Lisp_Object *));
Lisp_Object, Lisp_Object));
DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
doc: /* Signal an error. Args are ERROR-SYMBOL and associated DATA.
@ -1612,7 +1612,6 @@ See also the function `condition-case'. */)
Lisp_Object conditions;
extern int gc_in_progress;
extern int waiting_for_input;
Lisp_Object debugger_value;
Lisp_Object string;
Lisp_Object real_error_symbol;
struct backtrace *bp;
@ -1670,7 +1669,7 @@ See also the function `condition-case'. */)
register Lisp_Object clause;
clause = find_handler_clause (handlerlist->handler, conditions,
error_symbol, data, &debugger_value);
error_symbol, data);
if (EQ (clause, Qlambda))
{
@ -1701,7 +1700,7 @@ See also the function `condition-case'. */)
handlerlist = allhandlers;
/* If no handler is present now, try to run the debugger,
and if that fails, throw to top level. */
find_handler_clause (Qerror, conditions, error_symbol, data, &debugger_value);
find_handler_clause (Qerror, conditions, error_symbol, data);
if (catchlist != 0)
Fthrow (Qtop_level, Qt);
@ -1853,75 +1852,54 @@ skip_debugger (conditions, data)
= SIG is nil, and DATA is (SYMBOL . REST-OF-DATA).
This is for memory-full errors only.
Store value returned from debugger into *DEBUGGER_VALUE_PTR.
We need to increase max_specpdl_size temporarily around
anything we do that can push on the specpdl, so as not to get
a second error here in case we're handling specpdl overflow. */
static Lisp_Object
find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
find_handler_clause (handlers, conditions, sig, data)
Lisp_Object handlers, conditions, sig, data;
Lisp_Object *debugger_value_ptr;
{
register Lisp_Object h;
register Lisp_Object tem;
int debugger_called = 0;
int debugger_considered = 0;
if (EQ (handlers, Qt)) /* t is used by handlers for all conditions, set up by C code. */
/* t is used by handlers for all conditions, set up by C code. */
if (EQ (handlers, Qt))
return Qt;
/* Don't run the debugger for a memory-full error.
(There is no room in memory to do that!) */
if (NILP (sig))
debugger_considered = 1;
/* error is used similarly, but means print an error message
and run the debugger if that is enabled. */
if (EQ (handlers, Qerror)
|| !NILP (Vdebug_on_signal)) /* This says call debugger even if
there is a handler. */
{
int debugger_called = 0;
Lisp_Object sig_symbol, combined_data;
/* This is set to 1 if we are handling a memory-full error,
because these must not run the debugger.
(There is no room in memory to do that!) */
int no_debugger = 0;
if (NILP (sig))
{
combined_data = data;
sig_symbol = Fcar (data);
no_debugger = 1;
}
else
{
combined_data = Fcons (sig, data);
sig_symbol = sig;
}
if (wants_debugger (Vstack_trace_on_error, conditions))
if (!NILP (sig) && wants_debugger (Vstack_trace_on_error, conditions))
{
max_specpdl_size++;
#ifdef PROTOTYPES
#ifdef PROTOTYPES
internal_with_output_to_temp_buffer ("*Backtrace*",
(Lisp_Object (*) (Lisp_Object)) Fbacktrace,
Qnil);
#else
#else
internal_with_output_to_temp_buffer ("*Backtrace*",
Fbacktrace, Qnil);
#endif
#endif
max_specpdl_size--;
}
if (! no_debugger
/* Don't try to run the debugger with interrupts blocked.
The editing loop would return anyway. */
&& ! INPUT_BLOCKED_P
&& (EQ (sig_symbol, Qquit)
? debug_on_quit
: wants_debugger (Vdebug_on_error, conditions))
&& ! skip_debugger (conditions, combined_data)
&& when_entered_debugger < num_nonmacro_input_events)
if (!debugger_considered)
{
*debugger_value_ptr
= call_debugger (Fcons (Qerror,
Fcons (combined_data, Qnil)));
debugger_called = 1;
debugger_considered = 1;
debugger_called = maybe_call_debugger (conditions, sig, data);
}
/* If there is no handler, return saying whether we ran the debugger. */
if (EQ (handlers, Qerror))
{
@ -1930,6 +1908,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
return Qt;
}
}
for (h = handlers; CONSP (h); h = Fcdr (h))
{
Lisp_Object handler, condit;
@ -1948,18 +1927,55 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
/* Handle a list of condition names in handler HANDLER. */
else if (CONSP (condit))
{
while (CONSP (condit))
Lisp_Object tail;
for (tail = condit; CONSP (tail); tail = XCDR (tail))
{
tem = Fmemq (Fcar (condit), conditions);
tem = Fmemq (Fcar (tail), conditions);
if (!NILP (tem))
return handler;
condit = XCDR (condit);
{
/* This handler is going to apply.
Does it allow the debugger to run first? */
if (! debugger_considered && !NILP (Fmemq (Qdebug, condit)))
maybe_call_debugger (conditions, sig, data);
return handler;
}
}
}
}
return Qnil;
}
/* Call the debugger if calling it is currently enabled for CONDITIONS.
SIG and DATA describe the signal, as in find_handler_clause. */
int
maybe_call_debugger (conditions, sig, data)
Lisp_Object conditions, sig, data;
{
Lisp_Object combined_data;
combined_data = Fcons (sig, data);
if (
/* Don't try to run the debugger with interrupts blocked.
The editing loop would return anyway. */
! INPUT_BLOCKED_P
/* Does user wants to enter debugger for this kind of error? */
&& (EQ (sig, Qquit)
? debug_on_quit
: wants_debugger (Vdebug_on_error, conditions))
&& ! skip_debugger (conditions, combined_data)
/* rms: what's this for? */
&& when_entered_debugger < num_nonmacro_input_events)
{
call_debugger (Fcons (Qerror, Fcons (combined_data, Qnil)));
return 1;
}
return 0;
}
/* dump an error message; called like printf */
/* VARARGS 1 */
@ -3600,6 +3616,9 @@ before making `inhibit-quit' nil. */);
Qand_optional = intern ("&optional");
staticpro (&Qand_optional);
Qdebug = intern ("debug");
staticpro (&Qdebug);
DEFVAR_LISP ("stack-trace-on-error", &Vstack_trace_on_error,
doc: /* *Non-nil means errors display a backtrace buffer.
More precisely, this happens for any error that is handled

View file

@ -1422,7 +1422,7 @@ DEFUN ("track-mouse", Ftrack_mouse, Strack_mouse, 0, UNEVALLED, 0,
Within a `track-mouse' form, mouse motion generates input events that
you can read with `read-event'.
Normally, mouse motion is ignored.
usage: (track-mouse BODY ...) */)
usage: (track-mouse BODY...) */)
(args)
Lisp_Object args;
{

View file

@ -1179,7 +1179,7 @@ binding KEY to DEF is added at the front of KEYMAP. */)
if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
meta_bit = (VECTORP (key) || STRINGP (key) && STRING_MULTIBYTE (key)
meta_bit = (VECTORP (key) || (STRINGP (key) && STRING_MULTIBYTE (key))
? meta_modifier : 0x80);
if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0)))
@ -2079,12 +2079,23 @@ DEFUN ("current-minor-mode-maps", Fcurrent_minor_mode_maps, Scurrent_minor_mode_
/* Help functions for describing and documenting keymaps. */
struct accessible_keymaps_data {
Lisp_Object maps, tail, thisseq;
/* Does the current sequence end in the meta-prefix-char? */
int is_metized;
};
static void
accessible_keymaps_1 (key, cmd, maps, tail, thisseq, is_metized)
Lisp_Object maps, tail, thisseq, key, cmd;
int is_metized; /* If 1, `key' is assumed to be INTEGERP. */
accessible_keymaps_1 (key, cmd, args, data)
Lisp_Object key, cmd, args;
/* Use void* to be compatible with map_keymap_function_t. */
void *data;
{
struct accessible_keymaps_data *d = data; /* Cast! */
Lisp_Object maps = d->maps;
Lisp_Object tail = d->tail;
Lisp_Object thisseq = d->thisseq;
int is_metized = d->is_metized && INTEGERP (key);
Lisp_Object tem;
cmd = get_keymap (get_keyelt (cmd, 0), 0, 0);
@ -2138,17 +2149,6 @@ accessible_keymaps_1 (key, cmd, maps, tail, thisseq, is_metized)
}
}
static void
accessible_keymaps_char_table (args, index, cmd)
Lisp_Object args, index, cmd;
{
accessible_keymaps_1 (index, cmd,
XCAR (XCAR (args)),
XCAR (XCDR (args)),
XCDR (XCDR (args)),
XINT (XCDR (XCAR (args))));
}
/* This function cannot GC. */
DEFUN ("accessible-keymaps", Faccessible_keymaps, Saccessible_keymaps,
@ -2163,13 +2163,10 @@ then the value includes only maps for prefixes that start with PREFIX. */)
Lisp_Object keymap, prefix;
{
Lisp_Object maps, tail;
int prefixlen = 0;
int prefixlen = XINT (Flength (prefix));
/* no need for gcpro because we don't autoload any keymaps. */
if (!NILP (prefix))
prefixlen = XINT (Flength (prefix));
if (!NILP (prefix))
{
/* If a prefix was specified, start with the keymap (if any) for
@ -2180,7 +2177,9 @@ then the value includes only maps for prefixes that start with PREFIX. */)
if the prefix is not defined in this particular map.
It might even give us a list that isn't a keymap. */
tem = get_keymap (tem, 0, 0);
if (CONSP (tem))
/* If the keymap is autoloaded `tem' is not a cons-cell, but we still
want to return it. */
if (!NILP (tem))
{
/* Convert PREFIX to a vector now, so that later on
we don't have to deal with the possibility of a string. */
@ -2620,8 +2619,8 @@ ascii_sequence_p (seq)
/* where-is - finding a command in a set of keymaps. */
static Lisp_Object where_is_internal ();
static Lisp_Object where_is_internal_1 ();
static void where_is_internal_2 ();
static void where_is_internal_1 P_ ((Lisp_Object key, Lisp_Object binding,
Lisp_Object args, void *data));
/* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map.
Returns the first non-nil binding found in any of those maps. */
@ -2650,6 +2649,12 @@ shadow_lookup (shadow, key, flag)
static Lisp_Object Vmouse_events;
struct where_is_internal_data {
Lisp_Object definition, noindirect, this, last;
int last_is_meta;
Lisp_Object sequences;
};
/* This function can GC if Flookup_key autoloads any keymaps. */
static Lisp_Object
@ -2687,6 +2692,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
{
/* Key sequence to reach map, and the map that it reaches */
register Lisp_Object this, map, tem;
struct where_is_internal_data data;
/* In order to fold [META-PREFIX-CHAR CHAR] sequences into
[M-CHAR] sequences, check if last character of the sequence
@ -3059,7 +3065,7 @@ where_is_internal_1 (binding, key, definition, noindirect, this, last,
|| EQ (binding, definition)
|| (CONSP (definition) && !NILP (Fequal (binding, definition)))))
/* Doesn't match. */
return Qnil;
return;
/* We have found a match. Construct the key sequence where we found it. */
if (INTEGERP (key) && last_is_meta)
@ -3074,10 +3080,9 @@ where_is_internal_1 (binding, key, definition, noindirect, this, last,
{
Lisp_Object sequences = Fgethash (binding, where_is_cache, Qnil);
Fputhash (binding, Fcons (sequence, sequences), where_is_cache);
return Qnil;
}
else
return sequence;
d->sequences = Fcons (sequence, d->sequences);
}
/* describe-bindings - summarizing all the bindings in a set of keymaps. */

View file

@ -47,7 +47,7 @@ extern void syms_of_keymap P_ ((void));
extern void keys_of_keymap P_ ((void));
typedef void (*map_keymap_function_t)
P_ ((Lisp_Object, Lisp_Object, Lisp_Object, void*));
P_ ((Lisp_Object key, Lisp_Object val, Lisp_Object args, void* data));
extern void map_keymap P_ ((Lisp_Object map, map_keymap_function_t fun, Lisp_Object largs, void* cargs, int autoload));
#endif

View file

@ -56,7 +56,7 @@ Boston, MA 02110-1301, USA. */
#ifdef GC_CHECK_CONS_LIST
#define CHECK_CONS_LIST() check_cons_list()
#else
#define CHECK_CONS_LIST() 0
#define CHECK_CONS_LIST() ((void)0)
#endif
/* These are default choices for the types to use. */
@ -3234,6 +3234,7 @@ EXFUN (Fx_file_dialog, 5);
#endif
/* Defined in xfaces.c */
EXFUN (Fclear_face_cache, 1);
extern void syms_of_xfaces P_ ((void));
#ifndef HAVE_GETLOADAVG
@ -3249,6 +3250,7 @@ extern void syms_of_xfns P_ ((void));
extern void syms_of_xsmfns P_ ((void));
/* Defined in xselect.c */
EXFUN (Fx_send_client_event, 6);
extern void syms_of_xselect P_ ((void));
/* Defined in xterm.c */

View file

@ -147,7 +147,7 @@ LIBS = $(TLIB0) \
$(TLIB1) \
$(TLIBW32) \
$(TLASTLIB) \
$(WINMM) \
$(WINMM) \
$(ADVAPI32) \
$(GDI32) \
$(COMDLG32) \
@ -155,6 +155,7 @@ LIBS = $(TLIB0) \
$(MPR) \
$(SHELL32) \
$(WINSPOOL) \
$(OLE32) \
$(libc)
#

View file

@ -690,7 +690,7 @@ If variable `temp-buffer-show-function' is non-nil, call it at the end
to get the buffer displayed instead of just displaying the non-selected
buffer and calling the hook. It gets one argument, the buffer to display.
usage: (with-output-to-temp-buffer BUFNAME BODY ...) */)
usage: (with-output-to-temp-buffer BUFNAME BODY...) */)
(args)
Lisp_Object args;
{

View file

@ -121,14 +121,6 @@ Boston, MA 02110-1301, USA. */
#include <sys/wait.h>
#endif
/* Disable IPv6 support for w32 until someone figures out how to do it
properly. */
#ifdef WINDOWSNT
# ifdef AF_INET6
# undef AF_INET6
# endif
#endif
#include "lisp.h"
#include "systime.h"
#include "systty.h"
@ -393,7 +385,7 @@ struct sockaddr_and_len {
int len;
} datagram_address[MAXDESC];
#define DATAGRAM_CHAN_P(chan) (datagram_address[chan].sa != 0)
#define DATAGRAM_CONN_P(proc) (PROCESSP (proc) && datagram_address[XINT (XPROCESS (proc)->infd)].sa != 0)
#define DATAGRAM_CONN_P(proc) (PROCESSP (proc) && datagram_address[XPROCESS (proc)->infd].sa != 0)
#else
#define DATAGRAM_CHAN_P(chan) (0)
#define DATAGRAM_CONN_P(proc) (0)
@ -628,19 +620,19 @@ make_process (name)
p = allocate_process ();
XSETINT (p->infd, -1);
XSETINT (p->outfd, -1);
XSETFASTINT (p->tick, 0);
XSETFASTINT (p->update_tick, 0);
p->infd = -1;
p->outfd = -1;
p->tick = 0;
p->update_tick = 0;
p->pid = 0;
p->raw_status_new = 0;
p->status = Qrun;
p->mark = Fmake_marker ();
#ifdef ADAPTIVE_READ_BUFFERING
p->adaptive_read_buffering = Qnil;
XSETFASTINT (p->read_output_delay, 0);
p->read_output_skip = Qnil;
p->adaptive_read_buffering = 0;
p->read_output_delay = 0;
p->read_output_skip = 0;
#endif
/* If name is already in use, modify it until it is unused. */
@ -679,8 +671,8 @@ setup_process_coding_systems (process)
Lisp_Object process;
{
struct Lisp_Process *p = XPROCESS (process);
int inch = XINT (p->infd);
int outch = XINT (p->outfd);
int inch = p->infd;
int outch = p->outfd;
Lisp_Object coding_system;
if (inch < 0 || outch < 0)
@ -692,7 +684,7 @@ setup_process_coding_systems (process)
coding_system = p->decode_coding_system;
if (! NILP (p->filter))
{
if (NILP (p->filter_multibyte))
if (!p->filter_multibyte)
coding_system = raw_text_coding_system (coding_system);
}
else if (BUFFERP (p->buffer))
@ -814,10 +806,10 @@ nil, indicating the current buffer's process. */)
if (NETCONN1_P (p))
{
p->status = Fcons (Qexit, Fcons (make_number (0), Qnil));
XSETINT (p->tick, ++process_tick);
p->tick = ++process_tick;
status_notify (p);
}
else if (XINT (p->infd) >= 0)
else if (p->infd >= 0)
{
#ifdef SIGCHLD
Lisp_Object symbol;
@ -845,7 +837,7 @@ nil, indicating the current buffer's process. */)
/* Do this now, since remove_process will make sigchld_handler do nothing. */
p->status
= Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
XSETINT (p->tick, ++process_tick);
p->tick = ++process_tick;
status_notify (p);
}
}
@ -1037,18 +1029,18 @@ The string argument is normally a multibyte string, except:
(debug)
(set-process-filter process ...) */
if (XINT (p->infd) >= 0)
if (p->infd >= 0)
{
if (EQ (filter, Qt) && !EQ (p->status, Qlisten))
{
FD_CLR (XINT (p->infd), &input_wait_mask);
FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
FD_CLR (p->infd, &input_wait_mask);
FD_CLR (p->infd, &non_keyboard_wait_mask);
}
else if (EQ (p->filter, Qt)
&& !EQ (p->command, Qt)) /* Network process not stopped. */
{
FD_SET (XINT (p->infd), &input_wait_mask);
FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
FD_SET (p->infd, &input_wait_mask);
FD_SET (p->infd, &non_keyboard_wait_mask);
}
}
@ -1110,8 +1102,8 @@ DEFUN ("set-process-window-size", Fset_process_window_size,
CHECK_NATNUM (height);
CHECK_NATNUM (width);
if (XINT (XPROCESS (process)->infd) < 0
|| set_window_size (XINT (XPROCESS (process)->infd),
if (XPROCESS (process)->infd < 0
|| set_window_size (XPROCESS (process)->infd,
XINT (height), XINT (width)) <= 0)
return Qnil;
else
@ -1139,7 +1131,7 @@ for the process which will run. */)
register Lisp_Object process, flag;
{
CHECK_PROCESS (process);
XPROCESS (process)->inherit_coding_system_flag = flag;
XPROCESS (process)->inherit_coding_system_flag = !NILP (flag);
return flag;
}
@ -1154,7 +1146,7 @@ the process output. */)
register Lisp_Object process;
{
CHECK_PROCESS (process);
return XPROCESS (process)->inherit_coding_system_flag;
return XPROCESS (process)->inherit_coding_system_flag ? Qt : Qnil;
}
DEFUN ("set-process-query-on-exit-flag",
@ -1167,7 +1159,7 @@ exiting if PROCESS is running. */)
register Lisp_Object process, flag;
{
CHECK_PROCESS (process);
XPROCESS (process)->kill_without_query = Fnull (flag);
XPROCESS (process)->kill_without_query = NILP (flag);
return flag;
}
@ -1179,7 +1171,7 @@ DEFUN ("process-query-on-exit-flag",
register Lisp_Object process;
{
CHECK_PROCESS (process);
return Fnull (XPROCESS (process)->kill_without_query);
return (XPROCESS (process)->kill_without_query ? Qnil : Qt);
}
#ifdef DATAGRAM_SOCKETS
@ -1354,7 +1346,7 @@ list_processes_1 (query_only)
p = XPROCESS (proc);
if (NILP (p->childp))
continue;
if (!NILP (query_only) && !NILP (p->kill_without_query))
if (!NILP (query_only) && p->kill_without_query)
continue;
if (STRINGP (p->name)
&& ( i = SCHARS (p->name), (i > w_proc)))
@ -1417,7 +1409,7 @@ list_processes_1 (query_only)
p = XPROCESS (proc);
if (NILP (p->childp))
continue;
if (!NILP (query_only) && !NILP (p->kill_without_query))
if (!NILP (query_only) && p->kill_without_query)
continue;
Finsert (1, &p->name);
@ -1493,7 +1485,7 @@ list_processes_1 (query_only)
if (NILP (port))
port = Fformat_network_address (Fplist_get (p->childp, QClocal), Qnil);
sprintf (tembuf, "(network %s server on %s)\n",
(DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"),
(DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
(STRINGP (port) ? (char *)SDATA (port) : "?"));
insert_string (tembuf);
}
@ -1511,7 +1503,7 @@ list_processes_1 (query_only)
if (NILP (host))
host = Fformat_network_address (Fplist_get (p->childp, QCremote), Qnil);
sprintf (tembuf, "(network %s connection to %s)\n",
(DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"),
(DATAGRAM_CHAN_P (p->infd) ? "datagram" : "stream"),
(STRINGP (host) ? (char *)SDATA (host) : "?"));
insert_string (tembuf);
}
@ -1642,11 +1634,13 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
XPROCESS (proc)->sentinel = Qnil;
XPROCESS (proc)->filter = Qnil;
XPROCESS (proc)->filter_multibyte
= buffer_defaults.enable_multibyte_characters;
= !NILP (buffer_defaults.enable_multibyte_characters);
XPROCESS (proc)->command = Flist (nargs - 2, args + 2);
#ifdef ADAPTIVE_READ_BUFFERING
XPROCESS (proc)->adaptive_read_buffering = Vprocess_adaptive_read_buffering;
XPROCESS (proc)->adaptive_read_buffering
= (NILP (Vprocess_adaptive_read_buffering) ? 0
: EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2);
#endif
/* Make the process marker point into the process buffer (if any). */
@ -1777,13 +1771,11 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
#endif /* not VMS */
XPROCESS (proc)->decoding_buf = make_uninit_string (0);
XPROCESS (proc)->decoding_carryover = make_number (0);
XPROCESS (proc)->decoding_carryover = 0;
XPROCESS (proc)->encoding_buf = make_uninit_string (0);
XPROCESS (proc)->encoding_carryover = make_number (0);
XPROCESS (proc)->inherit_coding_system_flag
= (NILP (buffer) || !inherit_process_coding_system
? Qnil : Qt);
= (NILP (buffer) || !inherit_process_coding_system);
create_process (proc, (char **) new_argv, current_dir);
@ -1955,15 +1947,15 @@ create_process (process, new_argv, current_dir)
/* Record this as an active process, with its channels.
As a result, child_setup will close Emacs's side of the pipes. */
chan_process[inchannel] = process;
XSETINT (XPROCESS (process)->infd, inchannel);
XSETINT (XPROCESS (process)->outfd, outchannel);
XPROCESS (process)->infd = inchannel;
XPROCESS (process)->outfd = outchannel;
/* Previously we recorded the tty descriptor used in the subprocess.
It was only used for getting the foreground tty process, so now
we just reopen the device (see emacs_get_tty_pgrp) as this is
more portable (see USG_SUBTTY_WORKS above). */
XPROCESS (process)->pty_flag = (pty_flag ? Qt : Qnil);
XPROCESS (process)->pty_flag = pty_flag;
XPROCESS (process)->status = Qrun;
setup_process_coding_systems (process);
@ -2480,7 +2472,7 @@ DEFUN ("process-datagram-address", Fprocess_datagram_address, Sprocess_datagram_
if (!DATAGRAM_CONN_P (process))
return Qnil;
channel = XINT (XPROCESS (process)->infd);
channel = XPROCESS (process)->infd;
return conv_sockaddr_to_lisp (datagram_address[channel].sa,
datagram_address[channel].len);
}
@ -2500,7 +2492,7 @@ Returns nil upon error setting address, ADDRESS otherwise. */)
if (!DATAGRAM_CONN_P (process))
return Qnil;
channel = XINT (XPROCESS (process)->infd);
channel = XPROCESS (process)->infd;
len = get_lisp_to_sockaddr_size (address, &family);
if (datagram_address[channel].len != len)
@ -2665,7 +2657,7 @@ OPTION is not a supported option, return nil instead; otherwise return t. */)
if (!NETCONN1_P (p))
error ("Process is not a network process");
s = XINT (p->infd);
s = p->infd;
if (s < 0)
error ("Process is not running");
@ -3419,18 +3411,18 @@ usage: (make-network-process &rest ARGS) */)
p->buffer = buffer;
p->sentinel = sentinel;
p->filter = filter;
p->filter_multibyte = buffer_defaults.enable_multibyte_characters;
p->filter_multibyte = !NILP (buffer_defaults.enable_multibyte_characters);
/* Override the above only if :filter-multibyte is specified. */
if (! NILP (Fplist_member (contact, QCfilter_multibyte)))
p->filter_multibyte = Fplist_get (contact, QCfilter_multibyte);
p->filter_multibyte = !NILP (Fplist_get (contact, QCfilter_multibyte));
p->log = Fplist_get (contact, QClog);
if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
p->kill_without_query = Qt;
p->kill_without_query = 1;
if ((tem = Fplist_get (contact, QCstop), !NILP (tem)))
p->command = Qt;
p->pid = 0;
XSETINT (p->infd, inch);
XSETINT (p->outfd, outch);
p->infd = inch;
p->outfd = outch;
if (is_server && socktype == SOCK_STREAM)
p->status = Qlisten;
@ -3551,13 +3543,11 @@ usage: (make-network-process &rest ARGS) */)
setup_process_coding_systems (proc);
p->decoding_buf = make_uninit_string (0);
p->decoding_carryover = make_number (0);
p->decoding_carryover = 0;
p->encoding_buf = make_uninit_string (0);
p->encoding_carryover = make_number (0);
p->inherit_coding_system_flag
= (!NILP (tem) || NILP (buffer) || !inherit_process_coding_system
? Qnil : Qt);
= (!NILP (tem) || NILP (buffer) || !inherit_process_coding_system);
UNGCPRO;
return proc;
@ -3820,16 +3810,16 @@ deactivate_process (proc)
register int inchannel, outchannel;
register struct Lisp_Process *p = XPROCESS (proc);
inchannel = XINT (p->infd);
outchannel = XINT (p->outfd);
inchannel = p->infd;
outchannel = p->outfd;
#ifdef ADAPTIVE_READ_BUFFERING
if (XINT (p->read_output_delay) > 0)
if (p->read_output_delay > 0)
{
if (--process_output_delay_count < 0)
process_output_delay_count = 0;
XSETINT (p->read_output_delay, 0);
p->read_output_skip = Qnil;
p->read_output_delay = 0;
p->read_output_skip = 0;
}
#endif
@ -3851,8 +3841,8 @@ deactivate_process (proc)
emacs_close (outchannel);
#endif
XSETINT (p->infd, -1);
XSETINT (p->outfd, -1);
p->infd = -1;
p->outfd = -1;
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (inchannel))
{
@ -3900,8 +3890,8 @@ close_process_descs ()
process = chan_process[i];
if (!NILP (process))
{
int in = XINT (XPROCESS (process)->infd);
int out = XINT (XPROCESS (process)->outfd);
int in = XPROCESS (process)->infd;
int out = XPROCESS (process)->outfd;
if (in >= 0)
emacs_close (in);
if (out >= 0 && in != out)
@ -4145,8 +4135,8 @@ server_accept_connection (server, channel)
p->filter = ps->filter;
p->command = Qnil;
p->pid = 0;
XSETINT (p->infd, s);
XSETINT (p->outfd, s);
p->infd = s;
p->outfd = s;
p->status = Qrun;
/* Client processes for accepted connections are not stopped initially. */
@ -4169,12 +4159,11 @@ server_accept_connection (server, channel)
setup_process_coding_systems (proc);
p->decoding_buf = make_uninit_string (0);
p->decoding_carryover = make_number (0);
p->decoding_carryover = 0;
p->encoding_buf = make_uninit_string (0);
p->encoding_carryover = make_number (0);
p->inherit_coding_system_flag
= (NILP (buffer) ? Qnil : ps->inherit_coding_system_flag);
= (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
if (!NILP (ps->log))
call3 (ps->log, server, proc,
@ -4299,7 +4288,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
/* If wait_proc is a process to watch, set wait_channel accordingly. */
if (wait_proc != NULL)
wait_channel = XINT (wait_proc->infd);
wait_channel = wait_proc->infd;
record_unwind_protect (wait_reading_process_output_unwind,
make_number (waiting_for_user_input_p));
@ -4484,9 +4473,9 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
XSETPROCESS (proc, wait_proc);
/* Read data from the process, until we exhaust it. */
while (XINT (wait_proc->infd) >= 0)
while (wait_proc->infd >= 0)
{
nread = read_process_output (proc, XINT (wait_proc->infd));
nread = read_process_output (proc, wait_proc->infd);
if (nread == 0)
break;
@ -4516,9 +4505,9 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
if (wait_proc && just_wait_proc)
{
if (XINT (wait_proc->infd) < 0) /* Terminated */
if (wait_proc->infd < 0) /* Terminated */
break;
FD_SET (XINT (wait_proc->infd), &Available);
FD_SET (wait_proc->infd, &Available);
check_delay = 0;
IF_NON_BLOCKING_CONNECT (check_connect = 0);
}
@ -4566,7 +4555,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
#ifdef ADAPTIVE_READ_BUFFERING
/* Set the timeout for adaptive read buffering if any
process has non-nil read_output_skip and non-zero
process has non-zero read_output_skip and non-zero
read_output_delay, and we are not reading output for a
specific wait_channel. It is not executed if
Vprocess_adaptive_read_buffering is nil. */
@ -4581,16 +4570,16 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
if (NILP (proc))
continue;
/* Find minimum non-zero read_output_delay among the
processes with non-nil read_output_skip. */
if (XINT (XPROCESS (proc)->read_output_delay) > 0)
processes with non-zero read_output_skip. */
if (XPROCESS (proc)->read_output_delay > 0)
{
check_delay--;
if (NILP (XPROCESS (proc)->read_output_skip))
if (!XPROCESS (proc)->read_output_skip)
continue;
FD_CLR (channel, &Available);
XPROCESS (proc)->read_output_skip = Qnil;
if (XINT (XPROCESS (proc)->read_output_delay) < usecs)
usecs = XINT (XPROCESS (proc)->read_output_delay);
XPROCESS (proc)->read_output_skip = 0;
if (XPROCESS (proc)->read_output_delay < usecs)
usecs = XPROCESS (proc)->read_output_delay;
}
}
EMACS_SET_SECS_USECS (timeout, 0, usecs);
@ -4863,7 +4852,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
else
{
/* Preserve status of processes already terminated. */
XSETINT (XPROCESS (proc)->tick, ++process_tick);
XPROCESS (proc)->tick = ++process_tick;
deactivate_process (proc);
if (XPROCESS (proc)->raw_status_new)
update_status (XPROCESS (proc));
@ -4915,7 +4904,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
#endif
if (xerrno)
{
XSETINT (p->tick, ++process_tick);
p->tick = ++process_tick;
p->status = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil));
deactivate_process (proc);
}
@ -4928,8 +4917,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
exec_sentinel (proc, build_string ("open\n"));
if (!EQ (p->filter, Qt) && !EQ (p->command, Qt))
{
FD_SET (XINT (p->infd), &input_wait_mask);
FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
FD_SET (p->infd, &input_wait_mask);
FD_SET (p->infd, &non_keyboard_wait_mask);
}
}
}
@ -5003,7 +4992,7 @@ read_process_output (proc, channel)
register struct Lisp_Process *p = XPROCESS (proc);
register int opoint;
struct coding_system *coding = proc_decode_coding_system[channel];
int carryover = XINT (p->decoding_carryover);
int carryover = p->decoding_carryover;
int readmax = 4096;
#ifdef VMS
@ -5056,9 +5045,9 @@ read_process_output (proc, channel)
{
nbytes = emacs_read (channel, chars + carryover, readmax);
#ifdef ADAPTIVE_READ_BUFFERING
if (nbytes > 0 && !NILP (p->adaptive_read_buffering))
if (nbytes > 0 && p->adaptive_read_buffering)
{
int delay = XINT (p->read_output_delay);
int delay = p->read_output_delay;
if (nbytes < 256)
{
if (delay < READ_OUTPUT_DELAY_MAX_MAX)
@ -5074,10 +5063,10 @@ read_process_output (proc, channel)
if (delay == 0)
process_output_delay_count--;
}
XSETINT (p->read_output_delay, delay);
p->read_output_delay = delay;
if (delay)
{
p->read_output_skip = Qt;
p->read_output_skip = 1;
process_output_skip = 1;
}
}
@ -5095,7 +5084,7 @@ read_process_output (proc, channel)
}
#endif /* not VMS */
XSETINT (p->decoding_carryover, 0);
p->decoding_carryover = 0;
/* At this point, NBYTES holds number of bytes just received
(including the one in proc_buffered_char[channel]). */
@ -5169,12 +5158,12 @@ read_process_output (proc, channel)
valid memory because p->outfd will be changed once EOF is
sent to the process. */
if (NILP (p->encode_coding_system)
&& proc_encode_coding_system[XINT (p->outfd)])
&& proc_encode_coding_system[p->outfd])
{
p->encode_coding_system
= coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
setup_coding_system (p->encode_coding_system,
proc_encode_coding_system[XINT (p->outfd)]);
proc_encode_coding_system[p->outfd]);
}
}
@ -5184,10 +5173,10 @@ read_process_output (proc, channel)
p->decoding_buf = make_uninit_string (coding->carryover_bytes);
bcopy (coding->carryover, SDATA (p->decoding_buf),
coding->carryover_bytes);
XSETINT (p->decoding_carryover, coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
}
/* Adjust the multibyteness of TEXT to that of the filter. */
if (NILP (p->filter_multibyte) != ! STRING_MULTIBYTE (text))
if (p->filter_multibyte != STRING_MULTIBYTE (text))
text = (STRING_MULTIBYTE (text)
? Fstring_as_unibyte (text)
: Fstring_to_multibyte (text));
@ -5279,12 +5268,12 @@ read_process_output (proc, channel)
{
p->decode_coding_system = Vlast_coding_system_used;
if (NILP (p->encode_coding_system)
&& proc_encode_coding_system[XINT (p->outfd)])
&& proc_encode_coding_system[p->outfd])
{
p->encode_coding_system
= coding_inherit_eol_type (Vlast_coding_system_used, Qnil);
setup_coding_system (p->encode_coding_system,
proc_encode_coding_system[XINT (p->outfd)]);
proc_encode_coding_system[p->outfd]);
}
}
if (coding->carryover_bytes > 0)
@ -5293,7 +5282,7 @@ read_process_output (proc, channel)
p->decoding_buf = make_uninit_string (coding->carryover_bytes);
bcopy (coding->carryover, SDATA (p->decoding_buf),
coding->carryover_bytes);
XSETINT (p->decoding_carryover, coding->carryover_bytes);
p->decoding_carryover = coding->carryover_bytes;
}
/* Adjust the multibyteness of TEXT to that of the buffer. */
if (NILP (current_buffer->enable_multibyte_characters)
@ -5412,10 +5401,10 @@ send_process (proc, buf, len, object)
update_status (p);
if (! EQ (p->status, Qrun))
error ("Process %s not running", SDATA (p->name));
if (XINT (p->outfd) < 0)
if (p->outfd < 0)
error ("Output file descriptor of %s is closed", SDATA (p->name));
coding = proc_encode_coding_system[XINT (p->outfd)];
coding = proc_encode_coding_system[p->outfd];
Vlast_coding_system_used = CODING_ID_NAME (coding->id);
if ((STRINGP (object) && STRING_MULTIBYTE (object))
@ -5499,7 +5488,7 @@ send_process (proc, buf, len, object)
if (pty_max_bytes == 0)
{
#if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON)
pty_max_bytes = fpathconf (XFASTINT (p->outfd), _PC_MAX_CANON);
pty_max_bytes = fpathconf (p->outfd, _PC_MAX_CANON);
if (pty_max_bytes < 0)
pty_max_bytes = 250;
#else
@ -5521,7 +5510,7 @@ send_process (proc, buf, len, object)
/* Decide how much data we can send in one batch.
Long lines need to be split into multiple batches. */
if (!NILP (p->pty_flag))
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.
@ -5550,7 +5539,7 @@ send_process (proc, buf, len, object)
/* Send this batch, using one or more write calls. */
while (this > 0)
{
int outfd = XINT (p->outfd);
int outfd = p->outfd;
old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap);
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (outfd))
@ -5570,12 +5559,12 @@ send_process (proc, buf, len, object)
{
rv = emacs_write (outfd, (char *) buf, this);
#ifdef ADAPTIVE_READ_BUFFERING
if (XINT (p->read_output_delay) > 0
&& EQ (p->adaptive_read_buffering, Qt))
if (p->read_output_delay > 0
&& p->adaptive_read_buffering == 1)
{
XSETFASTINT (p->read_output_delay, 0);
p->read_output_delay = 0;
process_output_delay_count--;
p->read_output_skip = Qnil;
p->read_output_skip = 0;
}
#endif
}
@ -5618,7 +5607,7 @@ send_process (proc, buf, len, object)
if (errno == EAGAIN)
{
int flags = FWRITE;
ioctl (XINT (p->outfd), TIOCFLUSH, &flags);
ioctl (p->outfd, TIOCFLUSH, &flags);
}
#endif /* BROKEN_PTY_READ_AFTER_EAGAIN */
@ -5667,7 +5656,7 @@ send_process (proc, buf, len, object)
#endif
p->raw_status_new = 0;
p->status = Fcons (Qexit, Fcons (make_number (256), Qnil));
XSETINT (p->tick, ++process_tick);
p->tick = ++process_tick;
deactivate_process (proc);
#ifdef VMS
error ("Error writing to process %s; closed it", SDATA (p->name));
@ -5736,7 +5725,7 @@ emacs_get_tty_pgrp (p)
int gid = -1;
#ifdef TIOCGPGRP
if (ioctl (XINT (p->infd), TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name))
if (ioctl (p->infd, TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name))
{
int fd;
/* Some OS:es (Solaris 8/9) does not allow TIOCGPGRP from the
@ -5774,7 +5763,7 @@ return t unconditionally. */)
if (!EQ (p->childp, Qt))
error ("Process %s is not a subprocess",
SDATA (p->name));
if (XINT (p->infd) < 0)
if (p->infd < 0)
error ("Process %s is not active",
SDATA (p->name));
@ -5817,11 +5806,11 @@ process_send_signal (process, signo, current_group, nomsg)
if (!EQ (p->childp, Qt))
error ("Process %s is not a subprocess",
SDATA (p->name));
if (XINT (p->infd) < 0)
if (p->infd < 0)
error ("Process %s is not active",
SDATA (p->name));
if (NILP (p->pty_flag))
if (!p->pty_flag)
current_group = Qnil;
/* If we are using pgrps, get a pgrp number and make it negative. */
@ -5840,7 +5829,7 @@ process_send_signal (process, signo, current_group, nomsg)
struct termios t;
cc_t *sig_char = NULL;
tcgetattr (XINT (p->infd), &t);
tcgetattr (p->infd, &t);
switch (signo)
{
@ -5880,16 +5869,16 @@ process_send_signal (process, signo, current_group, nomsg)
switch (signo)
{
case SIGINT:
ioctl (XINT (p->infd), TIOCGETC, &c);
ioctl (p->infd, TIOCGETC, &c);
send_process (proc, &c.t_intrc, 1, Qnil);
return;
case SIGQUIT:
ioctl (XINT (p->infd), TIOCGETC, &c);
ioctl (p->infd, TIOCGETC, &c);
send_process (proc, &c.t_quitc, 1, Qnil);
return;
#ifdef SIGTSTP
case SIGTSTP:
ioctl (XINT (p->infd), TIOCGLTC, &lc);
ioctl (p->infd, TIOCGLTC, &lc);
send_process (proc, &lc.t_suspc, 1, Qnil);
return;
#endif /* ! defined (SIGTSTP) */
@ -5904,16 +5893,16 @@ process_send_signal (process, signo, current_group, nomsg)
switch (signo)
{
case SIGINT:
ioctl (XINT (p->infd), TCGETA, &t);
ioctl (p->infd, TCGETA, &t);
send_process (proc, &t.c_cc[VINTR], 1, Qnil);
return;
case SIGQUIT:
ioctl (XINT (p->infd), TCGETA, &t);
ioctl (p->infd, TCGETA, &t);
send_process (proc, &t.c_cc[VQUIT], 1, Qnil);
return;
#ifdef SIGTSTP
case SIGTSTP:
ioctl (XINT (p->infd), TCGETA, &t);
ioctl (p->infd, TCGETA, &t);
send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);
return;
#endif /* ! defined (SIGTSTP) */
@ -5971,7 +5960,7 @@ process_send_signal (process, signo, current_group, nomsg)
case SIGCONT:
p->raw_status_new = 0;
p->status = Qrun;
XSETINT (p->tick, ++process_tick);
p->tick = ++process_tick;
if (!nomsg)
status_notify (NULL);
break;
@ -5991,7 +5980,7 @@ process_send_signal (process, signo, current_group, nomsg)
sys$forcex (&(p->pid), 0, 1);
whoosh:
#endif
flush_pending_output (XINT (p->infd));
flush_pending_output (p->infd);
break;
}
@ -6008,7 +5997,7 @@ process_send_signal (process, signo, current_group, nomsg)
#ifdef TIOCSIGSEND
if (!NILP (current_group))
{
if (ioctl (XINT (p->infd), TIOCSIGSEND, signo) == -1)
if (ioctl (p->infd, TIOCSIGSEND, signo) == -1)
EMACS_KILLPG (gid, signo);
}
else
@ -6074,10 +6063,10 @@ If PROCESS is a network process, inhibit handling of incoming traffic. */)
p = XPROCESS (process);
if (NILP (p->command)
&& XINT (p->infd) >= 0)
&& p->infd >= 0)
{
FD_CLR (XINT (p->infd), &input_wait_mask);
FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
FD_CLR (p->infd, &input_wait_mask);
FD_CLR (p->infd, &non_keyboard_wait_mask);
}
p->command = Qt;
return process;
@ -6105,11 +6094,11 @@ If PROCESS is a network process, resume handling of incoming traffic. */)
p = XPROCESS (process);
if (EQ (p->command, Qt)
&& XINT (p->infd) >= 0
&& p->infd >= 0
&& (!EQ (p->filter, Qt) || EQ (p->status, Qlisten)))
{
FD_SET (XINT (p->infd), &input_wait_mask);
FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
FD_SET (p->infd, &input_wait_mask);
FD_SET (p->infd, &non_keyboard_wait_mask);
}
p->command = Qnil;
return process;
@ -6306,7 +6295,7 @@ text to PROCESS after you call this function. */)
return process;
proc = get_process (process);
coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)];
coding = proc_encode_coding_system[XPROCESS (proc)->outfd];
/* Make sure the process is really alive. */
if (XPROCESS (proc)->raw_status_new)
@ -6323,7 +6312,7 @@ text to PROCESS after you call this function. */)
#ifdef VMS
send_process (proc, "\032", 1, Qnil); /* ^z */
#else
if (!NILP (XPROCESS (proc)->pty_flag))
if (XPROCESS (proc)->pty_flag)
send_process (proc, "\004", 1, Qnil);
else
{
@ -6335,18 +6324,18 @@ text to PROCESS after you call this function. */)
(In some old system, shutdown to socketpair doesn't work.
Then we just can't win.) */
if (XPROCESS (proc)->pid == 0
|| XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd))
shutdown (XINT (XPROCESS (proc)->outfd), 1);
|| XPROCESS (proc)->outfd == XPROCESS (proc)->infd)
shutdown (XPROCESS (proc)->outfd, 1);
/* In case of socketpair, outfd == infd, so don't close it. */
if (XINT (XPROCESS (proc)->outfd) != XINT (XPROCESS (proc)->infd))
emacs_close (XINT (XPROCESS (proc)->outfd));
if (XPROCESS (proc)->outfd != XPROCESS (proc)->infd)
emacs_close (XPROCESS (proc)->outfd);
#else /* not HAVE_SHUTDOWN */
emacs_close (XINT (XPROCESS (proc)->outfd));
emacs_close (XPROCESS (proc)->outfd);
#endif /* not HAVE_SHUTDOWN */
new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0);
if (new_outfd < 0)
abort ();
old_outfd = XINT (XPROCESS (proc)->outfd);
old_outfd = XPROCESS (proc)->outfd;
if (!proc_encode_coding_system[new_outfd])
proc_encode_coding_system[new_outfd]
@ -6357,7 +6346,7 @@ text to PROCESS after you call this function. */)
bzero (proc_encode_coding_system[old_outfd],
sizeof (struct coding_system));
XSETINT (XPROCESS (proc)->outfd, new_outfd);
XPROCESS (proc)->outfd = new_outfd;
}
#endif /* VMS */
return process;
@ -6380,7 +6369,7 @@ kill_buffer_processes (buffer)
{
if (NETCONN_P (proc))
Fdelete_process (proc);
else if (XINT (XPROCESS (proc)->infd) >= 0)
else if (XPROCESS (proc)->infd >= 0)
process_send_signal (proc, SIGHUP, Qnil, 1);
}
}
@ -6510,21 +6499,21 @@ sigchld_handler (signo)
union { int i; WAITTYPE wt; } u;
int clear_desc_flag = 0;
XSETINT (p->tick, ++process_tick);
p->tick = ++process_tick;
u.wt = w;
p->raw_status = u.i;
p->raw_status_new = 1;
/* If process has terminated, stop waiting for its output. */
if ((WIFSIGNALED (w) || WIFEXITED (w))
&& XINT (p->infd) >= 0)
&& p->infd >= 0)
clear_desc_flag = 1;
/* We use clear_desc_flag to avoid a compiler bug in Microsoft C. */
if (clear_desc_flag)
{
FD_CLR (XINT (p->infd), &input_wait_mask);
FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
FD_CLR (p->infd, &input_wait_mask);
FD_CLR (p->infd, &non_keyboard_wait_mask);
}
/* Tell wait_reading_process_output that it needs to wake up and
@ -6701,18 +6690,18 @@ status_notify (deleting_process)
proc = Fcdr (Fcar (tail));
p = XPROCESS (proc);
if (XINT (p->tick) != XINT (p->update_tick))
if (p->tick != p->update_tick)
{
XSETINT (p->update_tick, XINT (p->tick));
p->update_tick = p->tick;
/* If process is still active, read any output that remains. */
while (! EQ (p->filter, Qt)
&& ! EQ (p->status, Qconnect)
&& ! EQ (p->status, Qlisten)
&& ! EQ (p->command, Qt) /* Network process not stopped. */
&& XINT (p->infd) >= 0
&& p->infd >= 0
&& p != deleting_process
&& read_process_output (proc, XINT (p->infd)) > 0);
&& read_process_output (proc, p->infd) > 0);
buffer = p->buffer;
@ -6739,7 +6728,7 @@ status_notify (deleting_process)
So set p->update_tick again
so that an error in the sentinel will not cause
this code to be run again. */
XSETINT (p->update_tick, XINT (p->tick));
p->update_tick = p->tick;
/* Now output the message suitably. */
if (!NILP (p->sentinel))
exec_sentinel (proc, msg);
@ -6812,9 +6801,9 @@ encode subprocess input. */)
CHECK_PROCESS (process);
p = XPROCESS (process);
if (XINT (p->infd) < 0)
if (p->infd < 0)
error ("Input file descriptor of %s closed", SDATA (p->name));
if (XINT (p->outfd) < 0)
if (p->outfd < 0)
error ("Output file descriptor of %s closed", SDATA (p->name));
Fcheck_coding_system (decoding);
Fcheck_coding_system (encoding);
@ -6851,7 +6840,7 @@ suppressed. */)
CHECK_PROCESS (process);
p = XPROCESS (process);
p->filter_multibyte = flag;
p->filter_multibyte = !NILP (flag);
setup_process_coding_systems (process);
return Qnil;
@ -6868,7 +6857,7 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
CHECK_PROCESS (process);
p = XPROCESS (process);
return (NILP (p->filter_multibyte) ? Qnil : Qt);
return (p->filter_multibyte ? Qt : Qnil);
}

View file

@ -36,10 +36,6 @@ struct Lisp_Process
{
EMACS_INT size;
struct Lisp_Vector *v_next;
/* Descriptor by which we read from this process */
Lisp_Object infd;
/* Descriptor by which we write to this process */
Lisp_Object outfd;
/* Name of subprocess terminal. */
Lisp_Object tty_name;
/* Name of this process */
@ -64,61 +60,65 @@ struct Lisp_Process
Lisp_Object plist;
/* Marker set to end of last buffer-inserted output from this process */
Lisp_Object mark;
/* Non-nil means kill silently if Emacs is exited.
This is the inverse of the `query-on-exit' flag. */
Lisp_Object kill_without_query;
/* Symbol indicating status of process.
This may be a symbol: run, open, or closed.
Or it may be a list, whose car is stop, exit or signal
and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG)
or (SIGNAL_NUMBER . COREDUMP_FLAG). */
Lisp_Object status;
/* Non-nil if communicating through a pty. */
Lisp_Object pty_flag;
/* Event-count of last event in which this process changed status. */
Lisp_Object tick;
/* Event-count of last such event reported. */
Lisp_Object update_tick;
/* Coding-system for decoding the input from this process. */
Lisp_Object decode_coding_system;
/* Working buffer for decoding. */
Lisp_Object decoding_buf;
/* Size of carryover in decoding. */
Lisp_Object decoding_carryover;
/* Coding-system for encoding the output to this process. */
Lisp_Object encode_coding_system;
/* Working buffer for encoding. */
Lisp_Object encoding_buf;
/* Size of carryover in encoding. */
Lisp_Object encoding_carryover;
/* Flag to set coding-system of the process buffer from the
coding_system used to decode process output. */
Lisp_Object inherit_coding_system_flag;
/* Flat to decide the multibyteness of a string given to the
filter (if any). It is initialized to the value of
`default-enable-multibyte-characters' when the process is
generated, and can be changed by the function
`set-process-fileter-multibyte'. */
Lisp_Object filter_multibyte;
/* Should we delay reading output from this process.
Initialized from `Vprocess_adaptive_read_buffering'. */
Lisp_Object adaptive_read_buffering;
/* Hysteresis to try to read process output in larger blocks.
On some systems, e.g. GNU/Linux, Emacs is seen as
an interactive app also when reading process output, meaning
that process output can be read in as little as 1 byte at a
time. Value is micro-seconds to delay reading output from
this process. Range is 0 .. 50000. */
Lisp_Object read_output_delay;
/* Skip reading this process on next read. */
Lisp_Object read_output_skip;
/* After this point, there are no Lisp_Objects any more. */
/* alloc.c assumes that `pid' is the first such non-Lisp slot. */
/* Number of this process.
allocate_process assumes this is the first non-Lisp_Object field.
A value 0 is used for pseudo-processes such as network connections. */
pid_t pid;
/* Descriptor by which we read from this process */
int infd;
/* Descriptor by which we write to this process */
int outfd;
/* Event-count of last event in which this process changed status. */
int tick;
/* Event-count of last such event reported. */
int update_tick;
/* Size of carryover in decoding. */
int decoding_carryover;
/* Hysteresis to try to read process output in larger blocks.
On some systems, e.g. GNU/Linux, Emacs is seen as
an interactive app also when reading process output, meaning
that process output can be read in as little as 1 byte at a
time. Value is micro-seconds to delay reading output from
this process. Range is 0 .. 50000. */
int read_output_delay;
/* Should we delay reading output from this process.
Initialized from `Vprocess_adaptive_read_buffering'.
0 = nil, 1 = t, 2 = other. */
int adaptive_read_buffering : 2;
/* Skip reading this process on next read. */
int read_output_skip : 1;
/* Non-nil means kill silently if Emacs is exited.
This is the inverse of the `query-on-exit' flag. */
int kill_without_query : 1;
/* Non-nil if communicating through a pty. */
int pty_flag : 1;
/* Flag to set coding-system of the process buffer from the
coding_system used to decode process output. */
int inherit_coding_system_flag : 1;
/* Flag to decide the multibyteness of a string given to the
filter (if any). It is initialized to the value of
`default-enable-multibyte-characters' when the process is
generated, and can be changed by the function
`set-process-filter-multibyte'. */
int filter_multibyte : 1;
/* Record the process status in the raw form in which it comes from `wait'.
This is to avoid consing in a signal handler. The `raw_status_new'
flag indicates that `raw_status' contains a new status that still

View file

@ -93,6 +93,11 @@ Lisp_Object Qsearch_failed;
Lisp_Object Vsearch_spaces_regexp;
/* If non-nil, the match data will not be changed during call to
searching or matching functions. This variable is for internal use
only. */
Lisp_Object Vinhibit_changing_match_data;
static void set_search_regs ();
static void save_search_regs ();
static int simple_search ();
@ -289,7 +294,9 @@ looking_at_1 (string, posix)
= current_buffer->case_eqv_table;
CHECK_STRING (string);
bufp = compile_pattern (string, &search_regs,
bufp = compile_pattern (string,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
(!NILP (current_buffer->case_fold_search)
? current_buffer->case_canon_table : Qnil),
posix,
@ -320,7 +327,9 @@ looking_at_1 (string, posix)
re_match_object = Qnil;
i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2,
PT_BYTE - BEGV_BYTE, &search_regs,
PT_BYTE - BEGV_BYTE,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
ZV_BYTE - BEGV_BYTE);
immediate_quit = 0;
@ -328,7 +337,7 @@ looking_at_1 (string, posix)
matcher_overflow ();
val = (0 <= i ? Qt : Qnil);
if (i >= 0)
if (NILP (Vinhibit_changing_match_data) && i >= 0)
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
{
@ -337,7 +346,11 @@ looking_at_1 (string, posix)
search_regs.end[i]
= BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
}
XSETBUFFER (last_thing_searched, current_buffer);
/* Set last_thing_searched only when match data is changed. */
if (NILP (Vinhibit_changing_match_data))
XSETBUFFER (last_thing_searched, current_buffer);
return val;
}
@ -399,7 +412,9 @@ string_match_1 (regexp, string, start, posix)
XCHAR_TABLE (current_buffer->case_canon_table)->extras[2]
= current_buffer->case_eqv_table;
bufp = compile_pattern (regexp, &search_regs,
bufp = compile_pattern (regexp,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
(!NILP (current_buffer->case_fold_search)
? current_buffer->case_canon_table : Qnil),
posix,
@ -410,21 +425,27 @@ string_match_1 (regexp, string, start, posix)
val = re_search (bufp, (char *) SDATA (string),
SBYTES (string), pos_byte,
SBYTES (string) - pos_byte,
&search_regs);
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL));
immediate_quit = 0;
last_thing_searched = Qt;
/* Set last_thing_searched only when match data is changed. */
if (NILP (Vinhibit_changing_match_data))
last_thing_searched = Qt;
if (val == -2)
matcher_overflow ();
if (val < 0) return Qnil;
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
{
search_regs.start[i]
= string_byte_to_char (string, search_regs.start[i]);
search_regs.end[i]
= string_byte_to_char (string, search_regs.end[i]);
}
if (NILP (Vinhibit_changing_match_data))
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
{
search_regs.start[i]
= string_byte_to_char (string, search_regs.start[i]);
search_regs.end[i]
= string_byte_to_char (string, search_regs.end[i]);
}
return make_number (string_byte_to_char (string, val));
}
@ -1042,6 +1063,11 @@ do \
} \
while (0)
/* Only used in search_buffer, to record the end position of the match
when searching regexps and SEARCH_REGS should not be changed
(i.e. Vinhibit_changing_match_data is non-nil). */
static struct re_registers search_regs_1;
static int
search_buffer (string, pos, pos_byte, lim, lim_byte, n,
RE, trt, inverse_trt, posix)
@ -1077,7 +1103,10 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
int s1, s2;
struct re_pattern_buffer *bufp;
bufp = compile_pattern (string, &search_regs, trt, posix,
bufp = compile_pattern (string,
(NILP (Vinhibit_changing_match_data)
? &search_regs : &search_regs_1),
trt, posix,
!NILP (current_buffer->enable_multibyte_characters));
immediate_quit = 1; /* Quit immediately if user types ^G,
@ -1110,7 +1139,8 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
int val;
val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
pos_byte - BEGV_BYTE, lim_byte - pos_byte,
&search_regs,
(NILP (Vinhibit_changing_match_data)
? &search_regs : &search_regs_1),
/* Don't allow match past current point */
pos_byte - BEGV_BYTE);
if (val == -2)
@ -1119,18 +1149,27 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
}
if (val >= 0)
{
pos_byte = search_regs.start[0] + BEGV_BYTE;
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
{
search_regs.start[i]
= BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
search_regs.end[i]
= BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
}
XSETBUFFER (last_thing_searched, current_buffer);
/* Set pos to the new position. */
pos = search_regs.start[0];
if (NILP (Vinhibit_changing_match_data))
{
pos_byte = search_regs.start[0] + BEGV_BYTE;
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
{
search_regs.start[i]
= BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
search_regs.end[i]
= BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
}
XSETBUFFER (last_thing_searched, current_buffer);
/* Set pos to the new position. */
pos = search_regs.start[0];
}
else
{
pos_byte = search_regs_1.start[0] + BEGV_BYTE;
/* Set pos to the new position. */
pos = BYTE_TO_CHAR (search_regs_1.start[0] + BEGV_BYTE);
}
}
else
{
@ -1144,7 +1183,8 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
int val;
val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2,
pos_byte - BEGV_BYTE, lim_byte - pos_byte,
&search_regs,
(NILP (Vinhibit_changing_match_data)
? &search_regs : &search_regs_1),
lim_byte - BEGV_BYTE);
if (val == -2)
{
@ -1152,17 +1192,25 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
}
if (val >= 0)
{
pos_byte = search_regs.end[0] + BEGV_BYTE;
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
{
search_regs.start[i]
= BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
search_regs.end[i]
= BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
}
XSETBUFFER (last_thing_searched, current_buffer);
pos = search_regs.end[0];
if (NILP (Vinhibit_changing_match_data))
{
pos_byte = search_regs.end[0] + BEGV_BYTE;
for (i = 0; i < search_regs.num_regs; i++)
if (search_regs.start[i] >= 0)
{
search_regs.start[i]
= BYTE_TO_CHAR (search_regs.start[i] + BEGV_BYTE);
search_regs.end[i]
= BYTE_TO_CHAR (search_regs.end[i] + BEGV_BYTE);
}
XSETBUFFER (last_thing_searched, current_buffer);
pos = search_regs.end[0];
}
else
{
pos_byte = search_regs_1.end[0] + BEGV_BYTE;
pos = BYTE_TO_CHAR (search_regs_1.end[0] + BEGV_BYTE);
}
}
else
{
@ -1907,7 +1955,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
cursor += dirlen - i - direction; /* fix cursor */
if (i + direction == 0)
{
int position;
int position, start, end;
cursor -= direction;
@ -1915,11 +1963,24 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
? 1 - len_byte : 0);
set_search_regs (position, len_byte);
if (NILP (Vinhibit_changing_match_data))
{
start = search_regs.start[0];
end = search_regs.end[0];
}
else
/* If Vinhibit_changing_match_data is non-nil,
search_regs will not be changed. So let's
compute start and end here. */
{
start = BYTE_TO_CHAR (position);
end = BYTE_TO_CHAR (position + len_byte);
}
if ((n -= direction) != 0)
cursor += dirlen; /* to resume search */
else
return ((direction > 0)
? search_regs.end[0] : search_regs.start[0]);
return direction > 0 ? end : start;
}
else
cursor += stride_for_teases; /* <sigh> we lose - */
@ -1984,18 +2045,30 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
pos_byte += dirlen - i- direction;
if (i + direction == 0)
{
int position;
int position, start, end;
pos_byte -= direction;
position = pos_byte + ((direction > 0) ? 1 - len_byte : 0);
set_search_regs (position, len_byte);
if (NILP (Vinhibit_changing_match_data))
{
start = search_regs.start[0];
end = search_regs.end[0];
}
else
/* If Vinhibit_changing_match_data is non-nil,
search_regs will not be changed. So let's
compute start and end here. */
{
start = BYTE_TO_CHAR (position);
end = BYTE_TO_CHAR (position + len_byte);
}
if ((n -= direction) != 0)
pos_byte += dirlen; /* to resume search */
else
return ((direction > 0)
? search_regs.end[0] : search_regs.start[0]);
return direction > 0 ? end : start;
}
else
pos_byte += stride_for_teases;
@ -2018,6 +2091,9 @@ set_search_regs (beg_byte, nbytes)
{
int i;
if (!NILP (Vinhibit_changing_match_data))
return;
/* Make sure we have registers in which to store
the match position. */
if (search_regs.num_regs == 0)
@ -3145,6 +3221,13 @@ or other such regexp constructs are not replaced with this.
A value of nil (which is the normal value) means treat spaces literally. */);
Vsearch_spaces_regexp = Qnil;
DEFVAR_LISP ("inhibit-changing-match-data", &Vinhibit_changing_match_data,
doc: /* Internal use only.
If non-nil, the match data will not be changed during call to searching or
matching functions, such as `looking-at', `string-match', `re-search-forward'
etc. */);
Vinhibit_changing_match_data = Qnil;
defsubr (&Slooking_at);
defsubr (&Sposix_looking_at);
defsubr (&Sstring_match);

View file

@ -25,6 +25,9 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "termchar.h"
#include "termopts.h"
@ -2493,9 +2496,9 @@ set_tty_color_mode (f, val)
void
term_mouse_moveto (int x, int y)
{
/* TODO: how to set mouse position?
const char *name;
int fd;
/* TODO: how to set mouse position?
name = (const char *) ttyname (0);
fd = open (name, O_WRONLY);
SOME_FUNCTION (x, y, fd);
@ -2509,7 +2512,7 @@ term_show_mouse_face (enum draw_glyphs_face draw)
{
struct window *w = XWINDOW (Qmouse_face_window);
int save_x, save_y;
int i, j;
int i;
if (/* If window is in the process of being destroyed, don't bother
to do anything. */
@ -3029,7 +3032,7 @@ int
handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit)
{
struct frame *f = SELECTED_FRAME ();
int i, j, fd;
int fd;
struct input_event ie;
int do_help = 0;
int count = 0;
@ -3053,7 +3056,7 @@ handle_one_term_event (Gpm_Event *event, struct input_event* hold_quit)
arg[1] = arg[3] = (unsigned short) event->y + gpm_zerobased;
arg[4] = (unsigned short) 3;
name = (const char *) ttyname (0);
name = ttyname (0);
fd = open (name, O_WRONLY);
ioctl (fd, TIOCLINUX, buf + sizeof (short) - 1);
close (fd);

View file

@ -53,6 +53,7 @@ Boston, MA 02110-1301, USA. */
#include <shellapi.h>
#include <ctype.h>
#include <winspool.h>
#include <objbase.h>
#include <dlgs.h>
#define FILE_NAME_TEXT_FIELD edt1
@ -2518,6 +2519,13 @@ w32_msg_pump (deferred_msg * msg_buf)
/* Produced by complete_deferred_msg; just ignore. */
break;
case WM_EMACS_CREATEWINDOW:
/* Initialize COM for this window. Even though we don't use it,
some third party shell extensions can cause it to be used in
system dialogs, which causes a crash if it is not initialized.
This is a known bug in Windows, which was fixed long ago, but
the patch for XP is not publically available until XP SP3,
and older versions will never be patched. */
CoInitialize (NULL);
w32_createwindow ((struct frame *) msg.wParam);
if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
abort ();
@ -3664,6 +3672,10 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
goto dflt;
case WM_DESTROY:
CoUninitialize ();
return 0;
case WM_CLOSE:
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);

Some files were not shown because too many files have changed in this diff Show more