diff options
| author | Glenn Morris | 2012-11-10 15:13:33 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-11-10 15:13:33 -0800 |
| commit | 6baf66d53bbedd85a443e0d69d1f4311a93f0677 (patch) | |
| tree | 38d7a00d5f7d5aecb86285d334fa15a31e5fbab1 /doc/misc | |
| parent | 05a859c1bd9cd07b2c0fad06a0694e88ea929fcf (diff) | |
| parent | e4e46889223296e8875548d278340b21db449a4a (diff) | |
| download | emacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.tar.gz emacs-6baf66d53bbedd85a443e0d69d1f4311a93f0677.zip | |
Merge from emacs-24; up to 2012-11-08T14:54:03Z!monnier@iro.umontreal.ca
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/ChangeLog | 29 | ||||
| -rw-r--r-- | doc/misc/cl.texi | 151 | ||||
| -rw-r--r-- | doc/misc/url.texi | 644 |
3 files changed, 482 insertions, 342 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 0a32fd82044..2518e72ef1e 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2012-11-10 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * url.texi (Introduction): Move url-configuration-directory to | ||
| 4 | Customization node. | ||
| 5 | (Parsed URIs): Split into its own node. | ||
| 6 | (URI Encoding): New node. | ||
| 7 | (Defining New URLs): Remove empty chapter. | ||
| 8 | (Retrieving URLs): Add an introduction. Doc fix for url-retrieve. | ||
| 9 | Improve docs for url-queue-*. | ||
| 10 | (Supported URL Types): Copyedits. Delete empty subnodes. | ||
| 11 | |||
| 12 | * url.texi (Introduction): Rename from Getting Started. Rewrite | ||
| 13 | the introduction. | ||
| 14 | (URI Parsing): Rewrite. Omit the obsolete attributes slot. | ||
| 15 | |||
| 16 | 2012-11-10 Glenn Morris <rgm@gnu.org> | ||
| 17 | |||
| 18 | * cl.texi (Obsolete Setf Customization): | ||
| 19 | Revert defsetf example to the more correct let rather than prog1. | ||
| 20 | Give define-modify-macro, defsetf, and define-setf-method | ||
| 21 | gv.el replacements. | ||
| 22 | |||
| 23 | * cl.texi (Overview): Mention EIEIO here, as well as the appendix. | ||
| 24 | (Setf Extensions): Remove obsolete reference. | ||
| 25 | (Obsolete Setf Customization): | ||
| 26 | Move note on lack of setf functions to lispref/variables.texi. | ||
| 27 | Undocument get-setf-method, since it no longer exists. | ||
| 28 | Mention simple defsetf replaced by gv-define-simple-setter. | ||
| 29 | |||
| 1 | 2012-11-03 Glenn Morris <rgm@gnu.org> | 30 | 2012-11-03 Glenn Morris <rgm@gnu.org> |
| 2 | 31 | ||
| 3 | * cl.texi: Further general copyedits. | 32 | * cl.texi: Further general copyedits. |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index e182c2600f9..a50be1027f3 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -107,7 +107,8 @@ for various reasons: | |||
| 107 | @item | 107 | @item |
| 108 | Some features are too complex or bulky relative to their benefit | 108 | Some features are too complex or bulky relative to their benefit |
| 109 | to Emacs Lisp programmers. CLOS and Common Lisp streams are fine | 109 | to Emacs Lisp programmers. CLOS and Common Lisp streams are fine |
| 110 | examples of this group. | 110 | examples of this group. (The separate package EIEIO implements |
| 111 | a subset of CLOS functionality. @xref{Top, , Introduction, eieio, EIEIO}.) | ||
| 111 | 112 | ||
| 112 | @item | 113 | @item |
| 113 | Other features cannot be implemented without modification to the | 114 | Other features cannot be implemented without modification to the |
| @@ -974,7 +975,7 @@ a | |||
| 974 | The generalized variable @code{buffer-substring}, listed above, | 975 | The generalized variable @code{buffer-substring}, listed above, |
| 975 | also works in this way by replacing a portion of the current buffer. | 976 | also works in this way by replacing a portion of the current buffer. |
| 976 | 977 | ||
| 977 | @c FIXME? Also `eq'? (see cl-lib.el) | 978 | @c FIXME? Also `eq'? (see cl-lib.el) |
| 978 | 979 | ||
| 979 | @c Currently commented out in cl.el. | 980 | @c Currently commented out in cl.el. |
| 980 | @ignore | 981 | @ignore |
| @@ -989,13 +990,10 @@ only interesting when used with places you define yourself with | |||
| 989 | @xref{Obsolete Setf Customization}. | 990 | @xref{Obsolete Setf Customization}. |
| 990 | @end ignore | 991 | @end ignore |
| 991 | 992 | ||
| 993 | @c FIXME? Is this still true? | ||
| 992 | @item | 994 | @item |
| 993 | A macro call, in which case the macro is expanded and @code{setf} | 995 | A macro call, in which case the macro is expanded and @code{setf} |
| 994 | is applied to the resulting form. | 996 | is applied to the resulting form. |
| 995 | |||
| 996 | @item | ||
| 997 | Any form for which a @code{defsetf} or @code{define-setf-method} | ||
| 998 | has been made. @xref{Obsolete Setf Customization}. | ||
| 999 | @end itemize | 997 | @end itemize |
| 1000 | 998 | ||
| 1001 | @c FIXME should this be in lispref? It seems self-evident. | 999 | @c FIXME should this be in lispref? It seems self-evident. |
| @@ -2867,7 +2865,6 @@ temporary variables. | |||
| 2867 | This function creates a new, uninterned symbol (using @code{make-symbol}) | 2865 | This function creates a new, uninterned symbol (using @code{make-symbol}) |
| 2868 | with a unique name. (The name of an uninterned symbol is relevant | 2866 | with a unique name. (The name of an uninterned symbol is relevant |
| 2869 | only if the symbol is printed.) By default, the name is generated | 2867 | only if the symbol is printed.) By default, the name is generated |
| 2870 | @c FIXME no longer true? | ||
| 2871 | from an increasing sequence of numbers, @samp{G1000}, @samp{G1001}, | 2868 | from an increasing sequence of numbers, @samp{G1000}, @samp{G1001}, |
| 2872 | @samp{G1002}, etc. If the optional argument @var{x} is a string, that | 2869 | @samp{G1002}, etc. If the optional argument @var{x} is a string, that |
| 2873 | string is used as a prefix instead of @samp{G}. Uninterned symbols | 2870 | string is used as a prefix instead of @samp{G}. Uninterned symbols |
| @@ -4481,14 +4478,6 @@ The @code{equal} predicate does not distinguish | |||
| 4481 | between IEEE floating-point plus and minus zero. The @code{cl-equalp} | 4478 | between IEEE floating-point plus and minus zero. The @code{cl-equalp} |
| 4482 | predicate has several differences with Common Lisp; @pxref{Predicates}. | 4479 | predicate has several differences with Common Lisp; @pxref{Predicates}. |
| 4483 | 4480 | ||
| 4484 | @c FIXME consider moving to lispref | ||
| 4485 | @ignore | ||
| 4486 | The @code{setf} mechanism is entirely compatible, except that | ||
| 4487 | setf-methods return a list of five values rather than five | ||
| 4488 | values directly. Also, the new ``@code{setf} function'' concept | ||
| 4489 | (typified by @code{(defun (setf foo) @dots{})}) is not implemented. | ||
| 4490 | @end ignore | ||
| 4491 | |||
| 4492 | The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} | 4481 | The @code{cl-do-all-symbols} form is the same as @code{cl-do-symbols} |
| 4493 | with no @var{obarray} argument. In Common Lisp, this form would | 4482 | with no @var{obarray} argument. In Common Lisp, this form would |
| 4494 | iterate over all symbols in all packages. Since Emacs obarrays | 4483 | iterate over all symbols in all packages. Since Emacs obarrays |
| @@ -4907,15 +4896,17 @@ Common Lisp defines three macros, @code{define-modify-macro}, | |||
| 4907 | @code{defsetf}, and @code{define-setf-method}, that allow the | 4896 | @code{defsetf}, and @code{define-setf-method}, that allow the |
| 4908 | user to extend generalized variables in various ways. | 4897 | user to extend generalized variables in various ways. |
| 4909 | In Emacs, these are obsolete, replaced by various features of | 4898 | In Emacs, these are obsolete, replaced by various features of |
| 4910 | @file{gv.el} in Emacs 24.3. Many of the implementation | 4899 | @file{gv.el} in Emacs 24.3. |
| 4911 | details in the following are out-of-date. | 4900 | @xref{Adding Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. |
| 4912 | @c FIXME this whole section needs updating. | 4901 | |
| 4913 | 4902 | ||
| 4914 | @defmac define-modify-macro name arglist function [doc-string] | 4903 | @defmac define-modify-macro name arglist function [doc-string] |
| 4915 | This macro defines a ``read-modify-write'' macro similar to | 4904 | This macro defines a ``read-modify-write'' macro similar to |
| 4916 | @code{cl-incf} and @code{cl-decf}. The macro @var{name} is defined | 4905 | @code{cl-incf} and @code{cl-decf}. You can replace this macro |
| 4917 | to take a @var{place} argument followed by additional arguments | 4906 | with @code{gv-letplace}. |
| 4918 | described by @var{arglist}. The call | 4907 | |
| 4908 | The macro @var{name} is defined to take a @var{place} argument | ||
| 4909 | followed by additional arguments described by @var{arglist}. The call | ||
| 4919 | 4910 | ||
| 4920 | @example | 4911 | @example |
| 4921 | (@var{name} @var{place} @var{args}@dots{}) | 4912 | (@var{name} @var{place} @var{args}@dots{}) |
| @@ -4938,8 +4929,8 @@ which in turn is roughly equivalent to | |||
| 4938 | For example: | 4929 | For example: |
| 4939 | 4930 | ||
| 4940 | @example | 4931 | @example |
| 4941 | (define-modify-macro cl-incf (&optional (n 1)) +) | 4932 | (define-modify-macro incf (&optional (n 1)) +) |
| 4942 | (define-modify-macro cl-concatf (&rest args) concat) | 4933 | (define-modify-macro concatf (&rest args) concat) |
| 4943 | @end example | 4934 | @end example |
| 4944 | 4935 | ||
| 4945 | Note that @code{&key} is not allowed in @var{arglist}, but | 4936 | Note that @code{&key} is not allowed in @var{arglist}, but |
| @@ -4948,16 +4939,31 @@ Note that @code{&key} is not allowed in @var{arglist}, but | |||
| 4948 | Most of the modify macros defined by Common Lisp do not exactly | 4939 | Most of the modify macros defined by Common Lisp do not exactly |
| 4949 | follow the pattern of @code{define-modify-macro}. For example, | 4940 | follow the pattern of @code{define-modify-macro}. For example, |
| 4950 | @code{push} takes its arguments in the wrong order, and @code{pop} | 4941 | @code{push} takes its arguments in the wrong order, and @code{pop} |
| 4951 | is completely irregular. You can define these macros ``by hand'' | 4942 | is completely irregular. |
| 4952 | using @code{get-setf-method}, or consult the source | 4943 | |
| 4953 | to see how to use the internal @code{setf} building blocks. | 4944 | The above @code{incf} example could be written using |
| 4945 | @code{gv-letplace} as: | ||
| 4946 | @example | ||
| 4947 | (defmacro incf (place &optional n) | ||
| 4948 | (gv-letplace (getter setter) place | ||
| 4949 | (macroexp-let2 nil v (or n 1) | ||
| 4950 | (funcall setter `(+ ,v ,getter))))) | ||
| 4951 | @end example | ||
| 4952 | @ignore | ||
| 4953 | (defmacro concatf (place &rest args) | ||
| 4954 | (gv-letplace (getter setter) place | ||
| 4955 | (macroexp-let2 nil v (mapconcat 'identity args "") | ||
| 4956 | (funcall setter `(concat ,getter ,v))))) | ||
| 4957 | @end ignore | ||
| 4954 | @end defmac | 4958 | @end defmac |
| 4955 | 4959 | ||
| 4956 | @defmac defsetf access-fn update-fn | 4960 | @defmac defsetf access-fn update-fn |
| 4957 | This is the simpler of two @code{defsetf} forms. Where | 4961 | This is the simpler of two @code{defsetf} forms, and is |
| 4958 | @var{access-fn} is the name of a function which accesses a place, | 4962 | replaced by @code{gv-define-simple-setter}. |
| 4959 | this declares @var{update-fn} to be the corresponding store | 4963 | |
| 4960 | function. From now on, | 4964 | With @var{access-fn} the name of a function that accesses a place, |
| 4965 | this declares @var{update-fn} to be the corresponding store function. | ||
| 4966 | From now on, | ||
| 4961 | 4967 | ||
| 4962 | @example | 4968 | @example |
| 4963 | (setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) | 4969 | (setf (@var{access-fn} @var{arg1} @var{arg2} @var{arg3}) @var{value}) |
| @@ -4972,7 +4978,7 @@ will be expanded to | |||
| 4972 | 4978 | ||
| 4973 | @noindent | 4979 | @noindent |
| 4974 | The @var{update-fn} is required to be either a true function, or | 4980 | The @var{update-fn} is required to be either a true function, or |
| 4975 | a macro which evaluates its arguments in a function-like way. Also, | 4981 | a macro that evaluates its arguments in a function-like way. Also, |
| 4976 | the @var{update-fn} is expected to return @var{value} as its result. | 4982 | the @var{update-fn} is expected to return @var{value} as its result. |
| 4977 | Otherwise, the above expansion would not obey the rules for the way | 4983 | Otherwise, the above expansion would not obey the rules for the way |
| 4978 | @code{setf} is supposed to behave. | 4984 | @code{setf} is supposed to behave. |
| @@ -4988,25 +4994,32 @@ something more like | |||
| 4988 | temp) | 4994 | temp) |
| 4989 | @end example | 4995 | @end example |
| 4990 | 4996 | ||
| 4991 | Some examples of the use of @code{defsetf}, drawn from the standard | 4997 | Some examples are: |
| 4992 | suite of setf methods, are: | ||
| 4993 | 4998 | ||
| 4994 | @example | 4999 | @example |
| 4995 | (defsetf car setcar) | 5000 | (defsetf car setcar) |
| 4996 | (defsetf symbol-value set) | ||
| 4997 | (defsetf buffer-name rename-buffer t) | 5001 | (defsetf buffer-name rename-buffer t) |
| 4998 | @end example | 5002 | @end example |
| 5003 | |||
| 5004 | These translate directly to @code{gv-define-simple-setter}: | ||
| 5005 | |||
| 5006 | @example | ||
| 5007 | (gv-define-simple-setter car setcar) | ||
| 5008 | (gv-define-simple-setter buffer-name rename-buffer t) | ||
| 5009 | @end example | ||
| 4999 | @end defmac | 5010 | @end defmac |
| 5000 | 5011 | ||
| 5001 | @defmac defsetf access-fn arglist (store-var) forms@dots{} | 5012 | @defmac defsetf access-fn arglist (store-var) forms@dots{} |
| 5002 | This is the second, more complex, form of @code{defsetf}. It is | 5013 | This is the second, more complex, form of @code{defsetf}. |
| 5003 | rather like @code{defmacro} except for the additional @var{store-var} | 5014 | It can be replaced by @code{gv-define-setter}. |
| 5004 | argument. The @var{forms} should return a Lisp form that stores | 5015 | |
| 5005 | the value of @var{store-var} into the generalized variable formed | 5016 | This form of @code{defsetf} is rather like @code{defmacro} except for |
| 5006 | by a call to @var{access-fn} with arguments described by @var{arglist}. | 5017 | the additional @var{store-var} argument. The @var{forms} should |
| 5007 | The @var{forms} may begin with a string which documents the @code{setf} | 5018 | return a Lisp form that stores the value of @var{store-var} into the |
| 5008 | method (analogous to the doc string that appears at the front of a | 5019 | generalized variable formed by a call to @var{access-fn} with |
| 5009 | function). | 5020 | arguments described by @var{arglist}. The @var{forms} may begin with |
| 5021 | a string which documents the @code{setf} method (analogous to the doc | ||
| 5022 | string that appears at the front of a function). | ||
| 5010 | 5023 | ||
| 5011 | For example, the simple form of @code{defsetf} is shorthand for | 5024 | For example, the simple form of @code{defsetf} is shorthand for |
| 5012 | 5025 | ||
| @@ -5021,20 +5034,28 @@ macros like @code{cl-incf} that invoke this | |||
| 5021 | setf-method will insert temporary variables as needed to make | 5034 | setf-method will insert temporary variables as needed to make |
| 5022 | sure the apparent order of evaluation is preserved. | 5035 | sure the apparent order of evaluation is preserved. |
| 5023 | 5036 | ||
| 5024 | Another example drawn from the standard package: | 5037 | Another standard example: |
| 5025 | 5038 | ||
| 5026 | @example | 5039 | @example |
| 5027 | (defsetf nth (n x) (store) | 5040 | (defsetf nth (n x) (store) |
| 5028 | (list 'setcar (list 'nthcdr n x) store)) | 5041 | `(setcar (nthcdr ,n ,x) ,store)) |
| 5042 | @end example | ||
| 5043 | |||
| 5044 | You could write this using @code{gv-define-setter} as: | ||
| 5045 | |||
| 5046 | @example | ||
| 5047 | (gv-define-setter nth (store n x) | ||
| 5048 | `(setcar (nthcdr ,n ,x) ,store)) | ||
| 5029 | @end example | 5049 | @end example |
| 5030 | @end defmac | 5050 | @end defmac |
| 5031 | 5051 | ||
| 5032 | @defmac define-setf-method access-fn arglist forms@dots{} | 5052 | @defmac define-setf-method access-fn arglist forms@dots{} |
| 5033 | This is the most general way to create new place forms. When | 5053 | This is the most general way to create new place forms. You can |
| 5034 | a @code{setf} to @var{access-fn} with arguments described by | 5054 | replace this by @code{gv-define-setter} or @code{gv-define-expander}. |
| 5035 | @var{arglist} is expanded, the @var{forms} are evaluated and | 5055 | |
| 5036 | must return a list of five items: | 5056 | When a @code{setf} to @var{access-fn} with arguments described by |
| 5037 | @c FIXME Is this still true? | 5057 | @var{arglist} is expanded, the @var{forms} are evaluated and must |
| 5058 | return a list of five items: | ||
| 5038 | 5059 | ||
| 5039 | @enumerate | 5060 | @enumerate |
| 5040 | @item | 5061 | @item |
| @@ -5063,6 +5084,9 @@ This is exactly like the Common Lisp macro of the same name, | |||
| 5063 | except that the method returns a list of five values rather | 5084 | except that the method returns a list of five values rather |
| 5064 | than the five values themselves, since Emacs Lisp does not | 5085 | than the five values themselves, since Emacs Lisp does not |
| 5065 | support Common Lisp's notion of multiple return values. | 5086 | support Common Lisp's notion of multiple return values. |
| 5087 | (Note that the @code{setf} implementation provided by @file{gv.el} | ||
| 5088 | does not use this five item format. Its use here is only for | ||
| 5089 | backwards compatibility.) | ||
| 5066 | 5090 | ||
| 5067 | Once again, the @var{forms} may begin with a documentation string. | 5091 | Once again, the @var{forms} may begin with a documentation string. |
| 5068 | 5092 | ||
| @@ -5078,45 +5102,22 @@ turn out to be unnecessary, so there is little reason for the | |||
| 5078 | setf-method itself to optimize. | 5102 | setf-method itself to optimize. |
| 5079 | @end defmac | 5103 | @end defmac |
| 5080 | 5104 | ||
| 5105 | @c Removed in Emacs 24.3, not possible to make a compatible replacement. | ||
| 5106 | @ignore | ||
| 5081 | @defun get-setf-method place &optional env | 5107 | @defun get-setf-method place &optional env |
| 5082 | This function returns the setf-method for @var{place}, by | 5108 | This function returns the setf-method for @var{place}, by |
| 5083 | invoking the definition previously recorded by @code{defsetf} | 5109 | invoking the definition previously recorded by @code{defsetf} |
| 5084 | or @code{define-setf-method}. The result is a list of five | 5110 | or @code{define-setf-method}. The result is a list of five |
| 5085 | values as described above. You can use this function to build | 5111 | values as described above. You can use this function to build |
| 5086 | your own @code{cl-incf}-like modify macros. | 5112 | your own @code{cl-incf}-like modify macros. |
| 5087 | @c These no longer exist. | ||
| 5088 | @ignore | ||
| 5089 | (Actually, it is better to use the internal functions | ||
| 5090 | @code{cl-setf-do-modify} and @code{cl-setf-do-store}, which are a bit | ||
| 5091 | easier to use and which also do a number of optimizations; consult the | ||
| 5092 | source code for the @code{cl-incf} function for a simple example.) | ||
| 5093 | @end ignore | ||
| 5094 | 5113 | ||
| 5095 | The argument @var{env} specifies the ``environment'' to be | 5114 | The argument @var{env} specifies the ``environment'' to be |
| 5096 | passed on to @code{macroexpand} if @code{get-setf-method} should | 5115 | passed on to @code{macroexpand} if @code{get-setf-method} should |
| 5097 | need to expand a macro in @var{place}. It should come from | 5116 | need to expand a macro in @var{place}. It should come from |
| 5098 | an @code{&environment} argument to the macro or setf-method | 5117 | an @code{&environment} argument to the macro or setf-method |
| 5099 | that called @code{get-setf-method}. | 5118 | that called @code{get-setf-method}. |
| 5100 | |||
| 5101 | @c FIXME No longer true. | ||
| 5102 | See also the source code for the setf-method for | ||
| 5103 | @c Also @code{apply}, but that is commented out. | ||
| 5104 | @code{substring}, which works by calling @code{get-setf-method} on a | ||
| 5105 | simpler case, then massaging the result. | ||
| 5106 | @end defun | 5119 | @end defun |
| 5107 | 5120 | @end ignore | |
| 5108 | @c FIXME does not belong here any more, maybe in lispref? | ||
| 5109 | Modern Common Lisp defines a second, independent way to specify | ||
| 5110 | the @code{setf} behavior of a function, namely ``@code{setf} | ||
| 5111 | functions'' whose names are lists @code{(setf @var{name})} | ||
| 5112 | rather than symbols. For example, @code{(defun (setf foo) @dots{})} | ||
| 5113 | defines the function that is used when @code{setf} is applied to | ||
| 5114 | @code{foo}. This package does not currently support @code{setf} | ||
| 5115 | functions. In particular, it is a compile-time error to use | ||
| 5116 | @code{setf} on a form which has not already been @code{defsetf}'d | ||
| 5117 | or otherwise declared; in newer Common Lisps, this would not be | ||
| 5118 | an error since the function @code{(setf @var{func})} might be | ||
| 5119 | defined later. | ||
| 5120 | 5121 | ||
| 5121 | 5122 | ||
| 5122 | @node GNU Free Documentation License | 5123 | @node GNU Free Documentation License |
diff --git a/doc/misc/url.texi b/doc/misc/url.texi index 898a9994a86..fdb3ab452f2 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | @end direntry | 18 | @end direntry |
| 19 | 19 | ||
| 20 | @copying | 20 | @copying |
| 21 | This file documents the Emacs Lisp URL loading package. | 21 | This is the manual for the @code{url} Emacs Lisp library. |
| 22 | 22 | ||
| 23 | Copyright @copyright{} 1993-1999, 2002, 2004-2012 Free Software Foundation, Inc. | 23 | Copyright @copyright{} 1993-1999, 2002, 2004-2012 Free Software Foundation, Inc. |
| 24 | 24 | ||
| @@ -57,10 +57,10 @@ developing GNU and promoting software freedom.'' | |||
| 57 | @end ifnottex | 57 | @end ifnottex |
| 58 | 58 | ||
| 59 | @menu | 59 | @menu |
| 60 | * Getting Started:: Preparing your program to use URLs. | 60 | * Introduction:: About the @code{url} library. |
| 61 | * URI Parsing:: Parsing (and unparsing) URIs. | ||
| 61 | * Retrieving URLs:: How to use this package to retrieve a URL. | 62 | * Retrieving URLs:: How to use this package to retrieve a URL. |
| 62 | * Supported URL Types:: Descriptions of URL types currently supported. | 63 | * Supported URL Types:: Descriptions of URL types currently supported. |
| 63 | * Defining New URLs:: How to define a URL loader for a new protocol. | ||
| 64 | * General Facilities:: URLs can be cached, accessed via a gateway | 64 | * General Facilities:: URLs can be cached, accessed via a gateway |
| 65 | and tracked in a history list. | 65 | and tracked in a history list. |
| 66 | * Customization:: Variables you can alter. | 66 | * Customization:: Variables you can alter. |
| @@ -70,93 +70,129 @@ developing GNU and promoting software freedom.'' | |||
| 70 | * Concept Index:: | 70 | * Concept Index:: |
| 71 | @end menu | 71 | @end menu |
| 72 | 72 | ||
| 73 | @node Getting Started | 73 | @node Introduction |
| 74 | @chapter Getting Started | 74 | @chapter Introduction |
| 75 | @cindex URLs, definition | 75 | @cindex URL |
| 76 | @cindex URIs | 76 | @cindex URI |
| 77 | @cindex uniform resource identifier | ||
| 78 | @cindex uniform resource locator | ||
| 77 | 79 | ||
| 78 | @dfn{Uniform Resource Locators} (URLs) are a specific form of | 80 | A @dfn{Uniform Resource Identifier} (URI) is a specially-formatted |
| 79 | @dfn{Uniform Resource Identifiers} (URI) described in RFC 2396 which | 81 | name, such as an Internet address, that identifies some name or |
| 80 | updates RFC 1738 and RFC 1808. RFC 2016 defines uniform resource | 82 | resource. The format of URIs is described in RFC 3986, which updates |
| 81 | agents. | 83 | and replaces the earlier RFCs 2732, 2396, 1808, and 1738. A |
| 84 | @dfn{Uniform Resource Locator} (URL) is an older but still-common | ||
| 85 | term, which basically refers to a URI corresponding to a resource that | ||
| 86 | can be accessed (usually over a network) in a specific way. | ||
| 82 | 87 | ||
| 83 | URIs have the form @var{scheme}:@var{scheme-specific-part}, where the | 88 | Here are some examples of URIs (taken from RFC 3986): |
| 84 | @var{scheme}s supported by this library are described below. | ||
| 85 | @xref{Supported URL Types}. | ||
| 86 | 89 | ||
| 87 | FTP, NFS, HTTP, HTTPS, @code{rlogin}, @code{telnet}, tn3270, | 90 | @example |
| 88 | IRC and gopher URLs all have the form | 91 | ftp://ftp.is.co.za/rfc/rfc1808.txt |
| 92 | http://www.ietf.org/rfc/rfc2396.txt | ||
| 93 | ldap://[2001:db8::7]/c=GB?objectClass?one | ||
| 94 | mailto:John.Doe@@example.com | ||
| 95 | news:comp.infosystems.www.servers.unix | ||
| 96 | tel:+1-816-555-1212 | ||
| 97 | telnet://192.0.2.16:80/ | ||
| 98 | urn:oasis:names:specification:docbook:dtd:xml:4.1.2 | ||
| 99 | @end example | ||
| 100 | |||
| 101 | This manual describes the @code{url} library, an Emacs Lisp library | ||
| 102 | for parsing URIs and retrieving the resources to which they refer. | ||
| 103 | (The library is so-named for historical reasons; nowadays, the ``URI'' | ||
| 104 | terminology is regarded as the more general one, and ``URL'' is | ||
| 105 | technically obsolete despite its widespread vernacular usage.) | ||
| 106 | |||
| 107 | @node URI Parsing | ||
| 108 | @chapter URI Parsing | ||
| 109 | |||
| 110 | A URI consists of several @dfn{components}, each having a different | ||
| 111 | meaning. For example, the URI | ||
| 89 | 112 | ||
| 90 | @example | 113 | @example |
| 91 | @var{scheme}://@r{[}@var{userinfo}@@@r{]}@var{hostname}@r{[}:@var{port}@r{]}@r{[}/@var{path}@r{]} | 114 | http://www.gnu.org/software/emacs/ |
| 92 | @end example | 115 | @end example |
| 116 | |||
| 93 | @noindent | 117 | @noindent |
| 94 | where @samp{@r{[}} and @samp{@r{]}} delimit optional parts. | 118 | specifies the scheme component @samp{http}, the hostname component |
| 95 | @var{userinfo} sometimes takes the form @var{username}:@var{password} | 119 | @samp{www.gnu.org}, and the path component @samp{/software/emacs/}. |
| 96 | but you should beware of the security risks of sending cleartext | 120 | |
| 97 | passwords. @var{hostname} may be a domain name or a dotted decimal | 121 | @cindex parsed URIs |
| 98 | address. If the @samp{:@var{port}} is omitted then the library will | 122 | The format of URIs is specified by RFC 3986. The @code{url} library |
| 99 | use the ``well known'' port for that service when accessing URLs. With | 123 | provides the Lisp function @code{url-generic-parse-url}, a (mostly) |
| 100 | the possible exception of @code{telnet}, it is rare for ports to be | 124 | standard-compliant URI parser, as well as function |
| 101 | specified, and it is possible using a non-standard port may have | 125 | @code{url-recreate-url}, which converts a parsed URI back into a URI |
| 102 | undesired consequences if a different service is listening on that | 126 | string. |
| 103 | port (e.g., an HTTP URL specifying the SMTP port can cause mail to be | 127 | |
| 104 | sent). @c , but @xref{Other Variables, url-bad-port-list}. | 128 | @defun url-generic-parse-url uri-string |
| 105 | The meaning of the @var{path} component depends on the service. | 129 | This function returns a parsed version of the string @var{uri-string}. |
| 130 | @end defun | ||
| 106 | 131 | ||
| 107 | @menu | 132 | @defun url-recreate-url uri-obj |
| 108 | * Configuration:: | 133 | @cindex unparsing URLs |
| 109 | * Parsed URLs:: URLs are parsed into vector structures. | 134 | Given a parsed URI, this function returns the corresponding URI string. |
| 110 | @end menu | 135 | @end defun |
| 111 | 136 | ||
| 112 | @node Configuration | 137 | @cindex parsed URI |
| 113 | @section Configuration | 138 | The return value of @code{url-generic-parse-url}, and the argument |
| 139 | expected by @code{url-recreate-url}, is a @dfn{parsed URI}: a CL | ||
| 140 | structure whose slots hold the various components of the URI. | ||
| 141 | @xref{top,the CL Manual,,cl,GNU Emacs Common Lisp Emulation}, for | ||
| 142 | details about CL structures. Most of the other functions in the | ||
| 143 | @code{url} library act on parsed URIs. | ||
| 114 | 144 | ||
| 115 | @defvar url-configuration-directory | 145 | @menu |
| 116 | @cindex @file{~/.url} | 146 | * Parsed URIs:: Format of parsed URI structures. |
| 117 | @cindex configuration files | 147 | * URI Encoding:: Non-@acronym{ASCII} characters in URIs. |
| 118 | The directory in which URL configuration files, the cache etc., | 148 | @end menu |
| 119 | reside. The old default was @file{~/.url}, and this directory | ||
| 120 | is still used if it exists. The new default is a @file{url/} | ||
| 121 | directory in @code{user-emacs-directory}, which is normally | ||
| 122 | @file{~/.emacs.d}. | ||
| 123 | @end defvar | ||
| 124 | 149 | ||
| 125 | @node Parsed URLs | 150 | @node Parsed URIs |
| 126 | @section Parsed URLs | 151 | @section Parsed URI structures |
| 127 | @cindex parsed URLs | ||
| 128 | The library functions typically operate on @dfn{parsed} versions of | ||
| 129 | URLs. These are actually CL structures (vectors) of the form: | ||
| 130 | 152 | ||
| 131 | @example | 153 | Each parsed URI structure contains the following slots: |
| 132 | [cl-struct-url @var{type} @var{user} @var{password} @var{host} @var{port} @var{filename} @var{target} @var{attributes} @var{fullness} @var{use-cookies}] | ||
| 133 | @end example | ||
| 134 | 154 | ||
| 135 | @noindent where | 155 | @table @code |
| 136 | @table @var | ||
| 137 | @item type | 156 | @item type |
| 138 | is the type of the URL scheme, e.g., @code{http} | 157 | The URI scheme (a string, e.g.@: @code{http}). @xref{Supported URL |
| 158 | Types}, for a list of schemes that the @code{url} library knows how to | ||
| 159 | process. This slot can also be @code{nil}, if the URI is not fully | ||
| 160 | specified. | ||
| 161 | |||
| 139 | @item user | 162 | @item user |
| 140 | is the username associated with it, or @code{nil}; | 163 | The user name (a string), or @code{nil}. |
| 164 | |||
| 141 | @item password | 165 | @item password |
| 142 | is the user password associated with it, or @code{nil}; | 166 | The user password (a string), or @code{nil}. The use of this URI |
| 167 | component is strongly discouraged; nowadays, passwords are transmitted | ||
| 168 | by other means, not as part of a URI. | ||
| 169 | |||
| 143 | @item host | 170 | @item host |
| 144 | is the host name associated with it, or @code{nil}; | 171 | The host name (a string), or @code{nil}. If present, this is |
| 172 | typically a domain name or IP address. | ||
| 173 | |||
| 145 | @item port | 174 | @item port |
| 146 | is the port number associated with it, or @code{nil}; | 175 | The port number (an integer), or @code{nil}. Omitting this component |
| 176 | usually means to use the ``standard'' port associated with the URI | ||
| 177 | scheme. | ||
| 178 | |||
| 147 | @item filename | 179 | @item filename |
| 148 | is the ``file'' part of it, or @code{nil}. This doesn't necessarily | 180 | The combination of the ``path'' and ``query'' components of the URI (a |
| 149 | actually refer to a file; | 181 | string), or @code{nil}. If the query component is present, it is the |
| 182 | substring following the first @samp{?} character, and the path | ||
| 183 | component is the substring before the @samp{?}. The meaning of these | ||
| 184 | components is scheme-dependent; they do not necessarily refer to a | ||
| 185 | file on a disk. | ||
| 186 | |||
| 150 | @item target | 187 | @item target |
| 151 | is the target part, or @code{nil}; | 188 | The fragment component (a string), or @code{nil}. The fragment |
| 152 | @item attributes | 189 | component specifies a ``secondary resource'', such as a section of a |
| 153 | is the attributes associated with it, or @code{nil}; | 190 | webpage. |
| 191 | |||
| 154 | @item fullness | 192 | @item fullness |
| 155 | is @code{t} for a fully-specified URL, with a host part indicated by | 193 | This is @code{t} if the URI is fully specified, i.e.@: the |
| 156 | @samp{//} after the scheme part. | 194 | hierarchical components of the URI (the hostname and/or username |
| 157 | @item use-cookies | 195 | and/or password) are preceded by @samp{//}. |
| 158 | is @code{nil} to neither send or store cookies to the server, @code{t} | ||
| 159 | otherwise. | ||
| 160 | @end table | 196 | @end table |
| 161 | 197 | ||
| 162 | @findex url-type | 198 | @findex url-type |
| @@ -168,64 +204,165 @@ otherwise. | |||
| 168 | @findex url-target | 204 | @findex url-target |
| 169 | @findex url-attributes | 205 | @findex url-attributes |
| 170 | @findex url-fullness | 206 | @findex url-fullness |
| 171 | These attributes have accessors named @code{url-@var{part}}, where | 207 | These slots have accessors named @code{url-@var{part}}, where |
| 172 | @var{part} is the name of one of the elements above, e.g., | 208 | @var{part} is the slot name. For example, the accessor for the |
| 173 | @code{url-host}. These attributes can be set with the same accessors | 209 | @code{host} slot is the function @code{url-host}. The @code{url-port} |
| 174 | using @code{setf}: | 210 | accessor returns the default port for the URI scheme if the parsed |
| 211 | URI's @var{port} slot is @code{nil}. | ||
| 212 | |||
| 213 | The slots can be set using @code{setf}. For example: | ||
| 175 | 214 | ||
| 176 | @example | 215 | @example |
| 177 | (setf (url-port url) 80) | 216 | (setf (url-port url) 80) |
| 178 | @end example | 217 | @end example |
| 179 | 218 | ||
| 180 | If @var{port} is @var{nil}, @code{url-port} returns the default port | 219 | @node URI Encoding |
| 181 | of the protocol. | 220 | @section URI Encoding |
| 182 | 221 | ||
| 183 | There are functions for parsing and unparsing between the string and | 222 | @cindex percent encoding |
| 184 | vector forms. | 223 | The @code{url-generic-parse-url} parser does not obey RFC 3986 in |
| 224 | one respect: it allows non-@acronym{ASCII} characters in URI strings. | ||
| 225 | |||
| 226 | Strictly speaking, RFC 3986 compatible URIs may only consist of | ||
| 227 | @acronym{ASCII} characters; non-@acronym{ASCII} characters are | ||
| 228 | represented by converting them to UTF-8 byte sequences, and performing | ||
| 229 | @dfn{percent encoding} on the bytes. For example, the o-umlaut | ||
| 230 | character is converted to the UTF-8 byte sequence @samp{\xD3\xA7}, | ||
| 231 | then percent encoded to @samp{%D3%A7}. (Certain ``reserved'' | ||
| 232 | @acronym{ASCII} characters must also be percent encoded when they | ||
| 233 | appear in URI components.) | ||
| 234 | |||
| 235 | The function @code{url-encode-url} can be used to convert a URI | ||
| 236 | string containing arbitrary characters to one that is properly | ||
| 237 | percent-encoded in accordance with RFC 3986. | ||
| 238 | |||
| 239 | @defun url-encode-url url-string | ||
| 240 | This function return a properly URI-encoded version of | ||
| 241 | @var{url-string}. It also performs @dfn{URI normalization}, | ||
| 242 | e.g.@: converting the scheme component to lowercase if it was | ||
| 243 | previously uppercase. | ||
| 244 | @end defun | ||
| 185 | 245 | ||
| 186 | @defun url-generic-parse-url url | 246 | To convert between a string containing arbitrary characters and a |
| 187 | Return a parsed version of the string @var{url}. | 247 | percent-encoded all-@acronym{ASCII} string, use the functions |
| 248 | @code{url-hexify-string} and @code{url-unhex-string}: | ||
| 249 | |||
| 250 | @defun url-hexify-string string &optional allowed-chars | ||
| 251 | This function performs percent-encoding on @var{string}, and returns | ||
| 252 | the result. | ||
| 253 | |||
| 254 | If @var{string} is multibyte, it is first converted to a UTF-8 byte | ||
| 255 | string. Each byte corresponding to an allowed character is left | ||
| 256 | as-is, while all other bytes are converted to a three-character | ||
| 257 | sequence: @samp{%} followed by two upper-case hex digits. | ||
| 258 | |||
| 259 | @vindex url-unreserved-chars | ||
| 260 | @cindex unreserved characters | ||
| 261 | The allowed characters are specified by @var{allowed-chars}. If this | ||
| 262 | argument is @code{nil}, the allowed characters are those specified as | ||
| 263 | @dfn{unreserved characters} by RFC 3986 (see the variable | ||
| 264 | @code{url-unreserved-chars}). Otherwise, @var{allowed-chars} should | ||
| 265 | be a vector whose @var{n}-th element is non-@code{nil} if character | ||
| 266 | @var{n} is allowed. | ||
| 188 | @end defun | 267 | @end defun |
| 189 | 268 | ||
| 190 | @defun url-recreate-url url | 269 | @defun url-unhex-string string &optional allow-newlines |
| 191 | @cindex unparsing URLs | 270 | This function replaces percent-encoding sequences in @var{string} with |
| 192 | Recreates a URL string from the parsed @var{url}. | 271 | their character equivalents, and returns the resulting string. |
| 272 | |||
| 273 | If @var{allow-newlines} is non-@code{nil}, it allows the decoding of | ||
| 274 | carriage returns and line feeds, which are normally forbidden in URIs. | ||
| 193 | @end defun | 275 | @end defun |
| 194 | 276 | ||
| 195 | @node Retrieving URLs | 277 | @node Retrieving URLs |
| 196 | @chapter Retrieving URLs | 278 | @chapter Retrieving URLs |
| 197 | 279 | ||
| 280 | The @code{url} library defines the following three functions for | ||
| 281 | retrieving the data specified by a URL. The actual retrieval protocol | ||
| 282 | depends on the URL's URI scheme, and is performed by lower-level | ||
| 283 | scheme-specific functions. (Those lower-level functions are not | ||
| 284 | documented here, and generally should not be called directly.) | ||
| 285 | |||
| 286 | In each of these functions, the @var{url} argument can be either a | ||
| 287 | string or a parsed URL structure. If it is a string, that string is | ||
| 288 | passed through @code{url-encode-url} before using it, to ensure that | ||
| 289 | it is properly URI-encoded (@pxref{URI Encoding}). | ||
| 290 | |||
| 198 | @defun url-retrieve-synchronously url | 291 | @defun url-retrieve-synchronously url |
| 199 | Retrieve @var{url} synchronously and return a buffer containing the | 292 | This function synchronously retrieves the data specified by @var{url}, |
| 200 | data. @var{url} is either a string or a parsed URL structure. Return | 293 | and returns a buffer containing the data. The return value is |
| 201 | @code{nil} if there are no data associated with it (the case for dired, | 294 | @code{nil} if there is no data associated with the URL (as is the case |
| 202 | info, or mailto URLs that need no further processing). | 295 | for @code{dired}, @code{info}, and @code{mailto} URLs). |
| 203 | @end defun | 296 | @end defun |
| 204 | 297 | ||
| 205 | @defun url-retrieve url callback &optional cbargs silent no-cookies | 298 | @defun url-retrieve url callback &optional cbargs silent no-cookies |
| 206 | Retrieve @var{url} asynchronously and call @var{callback} with args | 299 | This function retrieves @var{url} asynchronously, calling the function |
| 207 | @var{cbargs} when finished. The callback is called when the object | 300 | @var{callback} when the object has been completely retrieved. The |
| 208 | has been completely retrieved, with the current buffer containing the | 301 | return value is the buffer into which the data will be inserted, or |
| 209 | object and any MIME headers associated with it. @var{url} is either a | 302 | @code{nil} if the process has already completed. |
| 210 | string or a parsed URL structure. Returns the buffer @var{url} will | 303 | |
| 211 | load into, or @code{nil} if the process has already completed. | 304 | The callback function is called this way: |
| 212 | If the optional argument @var{silent} is non-@code{nil}, suppress | 305 | |
| 213 | progress messages. If the optional argument @var{no-cookies} is | 306 | @example |
| 214 | non-@code{nil}, do not store or send cookies. | 307 | (apply @var{callback} @var{status} @var{cbargs}) |
| 308 | @end example | ||
| 309 | |||
| 310 | @noindent | ||
| 311 | where @var{status} is a plist representing what happened during the | ||
| 312 | retrieval, with most recent events first, or an empty list if no | ||
| 313 | events have occurred. Each pair in the plist is one of: | ||
| 314 | |||
| 315 | @table @code | ||
| 316 | @item (:redirect @var{redirected-to}) | ||
| 317 | This means that the request was redirected to the URL | ||
| 318 | @var{redirected-to}. | ||
| 319 | |||
| 320 | @item (:error (@var{error-symbol} . @var{data})) | ||
| 321 | This means that an error occurred. If so desired, the error can be | ||
| 322 | signaled with @code{(signal @var{error-symbol} @var{data})}. | ||
| 323 | @end table | ||
| 324 | |||
| 325 | When the callback function is called, the current buffer is the one | ||
| 326 | containing the retrieved data (if any). The buffer also contains any | ||
| 327 | MIME headers associated with the data retrieval. | ||
| 328 | |||
| 329 | If the optional argument @var{silent} is non-@code{nil}, progress | ||
| 330 | messages are suppressed. If the optional argument @var{no-cookies} is | ||
| 331 | non-@code{nil}, cookies are not stored or sent. | ||
| 215 | @end defun | 332 | @end defun |
| 216 | 333 | ||
| 217 | @vindex url-queue-parallel-processes | ||
| 218 | @vindex url-queue-timeout | ||
| 219 | @defun url-queue-retrieve url callback &optional cbargs silent no-cookies | 334 | @defun url-queue-retrieve url callback &optional cbargs silent no-cookies |
| 220 | This acts like the @code{url-retrieve} function, but with limits on | 335 | This function acts like @code{url-retrieve}, but with limits on the |
| 221 | the degree of parallelism. The option @code{url-queue-parallel-processes} | 336 | number of concurrently-running network processes. The option |
| 222 | controls the number of concurrent processes, and the option | 337 | @code{url-queue-parallel-processes} controls the number of concurrent |
| 223 | @code{url-queue-timeout} sets a timeout in seconds. | 338 | processes, and the option @code{url-queue-timeout} sets a timeout in |
| 339 | seconds. | ||
| 340 | |||
| 341 | To use this function, you must @code{(require 'url-queue)}. | ||
| 224 | @end defun | 342 | @end defun |
| 225 | 343 | ||
| 344 | @vindex url-queue-parallel-processes | ||
| 345 | @defopt url-queue-parallel-processes | ||
| 346 | The value of this option is an integer specifying the maximum number | ||
| 347 | of concurrent @code{url-queue-retrieve} network processes. If the | ||
| 348 | number of @code{url-queue-retrieve} calls is larger than this number, | ||
| 349 | later ones are queued until ealier ones are finished. | ||
| 350 | @end defopt | ||
| 351 | |||
| 352 | @vindex url-queue-timeout | ||
| 353 | @defopt url-queue-timeout | ||
| 354 | The value of this option is a number specifying the maximum lifetime | ||
| 355 | of a @code{url-queue-retrieve} network process, once it is started. | ||
| 356 | If a process is not finished by then, it is killed and removed from | ||
| 357 | the queue. | ||
| 358 | @end defopt | ||
| 359 | |||
| 226 | @node Supported URL Types | 360 | @node Supported URL Types |
| 227 | @chapter Supported URL Types | 361 | @chapter Supported URL Types |
| 228 | 362 | ||
| 363 | This chapter describes functions and variables affecting URL retrieval | ||
| 364 | for specific schemes. | ||
| 365 | |||
| 229 | @menu | 366 | @menu |
| 230 | * http/https:: Hypertext Transfer Protocol. | 367 | * http/https:: Hypertext Transfer Protocol. |
| 231 | * file/ftp:: Local files and FTP archives. | 368 | * file/ftp:: Local files and FTP archives. |
| @@ -236,48 +373,31 @@ controls the number of concurrent processes, and the option | |||
| 236 | * irc:: Internet Relay Chat. | 373 | * irc:: Internet Relay Chat. |
| 237 | * data:: Embedded data URLs. | 374 | * data:: Embedded data URLs. |
| 238 | * nfs:: Networked File System | 375 | * nfs:: Networked File System |
| 239 | @c * finger:: | ||
| 240 | @c * gopher:: | ||
| 241 | @c * netrek:: | ||
| 242 | @c * prospero:: | ||
| 243 | * cid:: Content-ID. | ||
| 244 | * about:: | ||
| 245 | * ldap:: Lightweight Directory Access Protocol | 376 | * ldap:: Lightweight Directory Access Protocol |
| 246 | * imap:: IMAP mailboxes. | ||
| 247 | * man:: Unix man pages. | 377 | * man:: Unix man pages. |
| 248 | @end menu | 378 | @end menu |
| 249 | 379 | ||
| 250 | @node http/https | 380 | @node http/https |
| 251 | @section @code{http} and @code{https} | 381 | @section @code{http} and @code{https} |
| 252 | 382 | ||
| 253 | The scheme @code{http} is Hypertext Transfer Protocol. The library | 383 | The @code{http} scheme refers to the Hypertext Transfer Protocol. The |
| 254 | supports version 1.1, specified in RFC 2616. (This supersedes 1.0, | 384 | @code{url} library supports HTTP version 1.1, specified in RFC 2616. |
| 255 | defined in RFC 1945) HTTP URLs have the following form, where most of | 385 | Its default port is 80. |
| 256 | the parts are optional: | 386 | |
| 257 | @example | 387 | The @code{https} scheme is a secure version of @code{http}, with |
| 258 | http://@var{user}:@var{password}@@@var{host}:@var{port}/@var{path}?@var{searchpart}#@var{fragment} | 388 | transmission via SSL. It is defined in RFC 2069, and its default port |
| 259 | @end example | 389 | is 443. When using @code{https}, the @code{url} library performs SSL |
| 260 | @c The @code{:@var{port}} part is optional, and @var{port} defaults to | 390 | encryption via the @code{ssl} library, by forcing the @code{ssl} |
| 261 | @c 80. The @code{/@var{path}} part, if present, is a slash-separated | 391 | gateway method to be used. @xref{Gateways in general}. |
| 262 | @c series elements. The @code{?@var{searchpart}}, if present, is the | ||
| 263 | @c query for a search or the content of a form submission. The | ||
| 264 | @c @code{#fragment} part, if present, is a location in the document. | ||
| 265 | |||
| 266 | The scheme @code{https} is a secure version of @code{http}, with | ||
| 267 | transmission via SSL. It is defined in RFC 2069. Its default port is | ||
| 268 | 443. This scheme depends on SSL support in Emacs via the | ||
| 269 | @file{ssl.el} library and is actually implemented by forcing the | ||
| 270 | @code{ssl} gateway method to be used. @xref{Gateways in general}. | ||
| 271 | 392 | ||
| 272 | @defopt url-honor-refresh-requests | 393 | @defopt url-honor-refresh-requests |
| 273 | This controls honoring of HTTP @samp{Refresh} headers by which | 394 | If this option is non-@code{nil} (the default), the @code{url} library |
| 274 | servers can direct clients to reload documents from the same URL or a | 395 | honors the HTTP @samp{Refresh} header, which is used by servers to |
| 275 | or different one. @code{nil} means they will not be honored, | 396 | direct clients to reload documents from the same URL or a or different |
| 276 | @code{t} (the default) means they will always be honored, and | 397 | one. If the value is @code{nil}, the @samp{Refresh} header is |
| 277 | otherwise the user will be asked on each request. | 398 | ignored; any other value means to ask the user on each request. |
| 278 | @end defopt | 399 | @end defopt |
| 279 | 400 | ||
| 280 | |||
| 281 | @menu | 401 | @menu |
| 282 | * Cookies:: | 402 | * Cookies:: |
| 283 | * HTTP language/coding:: | 403 | * HTTP language/coding:: |
| @@ -409,26 +529,32 @@ emacs-mime, The Emacs MIME Manual}. | |||
| 409 | @cindex compressed files | 529 | @cindex compressed files |
| 410 | @cindex dired | 530 | @cindex dired |
| 411 | 531 | ||
| 532 | The @code{ftp} and @code{file} schemes are defined in RFC 1808. The | ||
| 533 | @code{url} library treats @samp{ftp:} and @samp{file:} as synonymous. | ||
| 534 | Such URLs have the form | ||
| 535 | |||
| 412 | @example | 536 | @example |
| 413 | ftp://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} | 537 | ftp://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} |
| 414 | file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} | 538 | file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} |
| 415 | @end example | 539 | @end example |
| 416 | 540 | ||
| 417 | These schemes are defined in RFC 1808. | 541 | @noindent |
| 418 | @samp{ftp:} and @samp{file:} are synonymous in this library. They | 542 | If the URL specifies a local file, it is retrieved by reading the file |
| 419 | allow reading arbitrary files from hosts. Either @samp{ange-ftp} | 543 | contents in the usual way. If it specifies a remote file, it is |
| 420 | (Emacs) or @samp{efs} (XEmacs) is used to retrieve them from remote | 544 | retrieved using the Ange-FTP package. @xref{Remote Files,,, emacs, |
| 421 | hosts. Local files are accessed directly. | 545 | The GNU Emacs Manual}. |
| 422 | 546 | ||
| 423 | Compressed files are handled, but support is hard-coded so that | 547 | When retrieving a compressed file, it is automatically uncompressed |
| 424 | @code{jka-compr-compression-info-list} and so on have no affect. | 548 | if it has the file suffix @file{.z}, @file{.gz}, @file{.Z}, |
| 425 | Suffixes recognized are @samp{.z}, @samp{.gz}, @samp{.Z} and | 549 | @file{.bz2}, or @file{.xz}. (The list of supported suffixes is |
| 426 | @samp{.bz2}. | 550 | hard-coded, and cannot be altered by customizing |
| 551 | @code{jka-compr-compression-info-list}.) | ||
| 427 | 552 | ||
| 428 | @defopt url-directory-index-file | 553 | @defopt url-directory-index-file |
| 429 | The filename to look for when indexing a directory, default | 554 | This option specifies the filename to look for when a @code{file} or |
| 430 | @samp{"index.html"}. If this file exists, and is readable, then it | 555 | @code{ftp} URL specifies a directory. The default is |
| 431 | will be viewed instead of using @code{dired} to view the directory. | 556 | @file{index.html}. If this file exists and is readable, it is viewed. |
| 557 | Otherwise, Emacs visits the directory using Dired. | ||
| 432 | @end defopt | 558 | @end defopt |
| 433 | 559 | ||
| 434 | @node info | 560 | @node info |
| @@ -437,47 +563,53 @@ will be viewed instead of using @code{dired} to view the directory. | |||
| 437 | @cindex Texinfo | 563 | @cindex Texinfo |
| 438 | @findex Info-goto-node | 564 | @findex Info-goto-node |
| 439 | 565 | ||
| 566 | The @code{info} scheme is non-standard. Such URLs have the form | ||
| 567 | |||
| 440 | @example | 568 | @example |
| 441 | info:@var{file}#@var{node} | 569 | info:@var{file}#@var{node} |
| 442 | @end example | 570 | @end example |
| 443 | 571 | ||
| 444 | Info URLs are not officially defined. They invoke | 572 | @noindent |
| 445 | @code{Info-goto-node} with argument @samp{(@var{file})@var{node}}. | 573 | and are retrieved by invoking @code{Info-goto-node} with argument |
| 446 | @samp{#@var{node}} is optional, defaulting to @samp{Top}. | 574 | @samp{(@var{file})@var{node}}. If @samp{#@var{node}} is omitted, the |
| 575 | @samp{Top} node is opened. | ||
| 447 | 576 | ||
| 448 | @node mailto | 577 | @node mailto |
| 449 | @section mailto | 578 | @section mailto |
| 450 | 579 | ||
| 451 | @cindex mailto | 580 | @cindex mailto |
| 452 | @cindex email | 581 | @cindex email |
| 453 | A mailto URL will send an email message to the address in the | 582 | A @code{mailto} URL specifies an email message to be sent to a given |
| 454 | URL, for example @samp{mailto:foo@@bar.com} would compose a | 583 | email address. For example, @samp{mailto:foo@@bar.com} specifies |
| 455 | message to @samp{foo@@bar.com}. | 584 | sending a message to @samp{foo@@bar.com}. The ``retrieval method'' |
| 456 | 585 | for such URLs is to open a mail composition buffer in which the | |
| 457 | @defopt url-mail-command | 586 | appropriate content (e.g.@: the recipient address) has been filled in. |
| 458 | @vindex mail-user-agent | ||
| 459 | The function called whenever url needs to send mail. This should | ||
| 460 | normally be left to default from @var{mail-user-agent}. @xref{Mail | ||
| 461 | Methods, , Mail-Composition Methods, emacs, The GNU Emacs Manual}. | ||
| 462 | @end defopt | ||
| 463 | 587 | ||
| 464 | An @samp{X-Url-From} header field containing the URL of the document | 588 | As defined in RFC 2368, a @code{mailto} URL has the form |
| 465 | that contained the mailto URL is added if that URL is known. | ||
| 466 | 589 | ||
| 467 | RFC 2368 extends the definition of mailto URLs in RFC 1738. | ||
| 468 | The form of a mailto URL is | ||
| 469 | @example | 590 | @example |
| 470 | @samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]} | 591 | @samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]} |
| 471 | @end example | 592 | @end example |
| 472 | @noindent where an arbitrary number of @var{header}s can be added. If the | ||
| 473 | @var{header} is @samp{body}, then @var{contents} is put in the body | ||
| 474 | otherwise a @var{header} header field is created with @var{contents} | ||
| 475 | as its contents. Note that the URL library does not consider any | ||
| 476 | headers ``dangerous'' so you should check them before sending the | ||
| 477 | message. | ||
| 478 | 593 | ||
| 479 | @c Fixme: update | 594 | @noindent |
| 480 | Email messages are defined in @sc{rfc}822. | 595 | where an arbitrary number of @var{header}s can be added. If the |
| 596 | @var{header} is @samp{body}, then @var{contents} is put in the message | ||
| 597 | body; otherwise, a @var{header} header field is created with | ||
| 598 | @var{contents} as its contents. Note that the @code{url} library does | ||
| 599 | not perform any checking of @var{header} or @var{contents}, so you | ||
| 600 | should check them before sending the message. | ||
| 601 | |||
| 602 | @defopt url-mail-command | ||
| 603 | @vindex mail-user-agent | ||
| 604 | The value of this variable is the function called whenever url needs | ||
| 605 | to send mail. This should normally be left its default, which is the | ||
| 606 | standard mail-composition command @code{compose-mail}. @xref{Sending | ||
| 607 | Mail,,, emacs, The GNU Emacs Manual}. | ||
| 608 | @end defopt | ||
| 609 | |||
| 610 | If the document containing the @code{mailto} URL itself possessed a | ||
| 611 | known URL, Emacs automatically inserts an @samp{X-Url-From} header | ||
| 612 | field into the mail buffer, specifying that URL. | ||
| 481 | 613 | ||
| 482 | @node news/nntp/snews | 614 | @node news/nntp/snews |
| 483 | @section @code{news}, @code{nntp} and @code{snews} | 615 | @section @code{news}, @code{nntp} and @code{snews} |
| @@ -487,11 +619,13 @@ Email messages are defined in @sc{rfc}822. | |||
| 487 | @cindex NNTP | 619 | @cindex NNTP |
| 488 | @cindex snews | 620 | @cindex snews |
| 489 | 621 | ||
| 490 | @c draft-gilman-news-url-01 | 622 | The @code{news}, @code{nntp}, and @code{snews} schemes, defined in RFC |
| 491 | The network news URL scheme take the following forms following RFC | 623 | 1738, are used for reading Usenet newsgroups. For compatibility with |
| 492 | 1738 except that for compatibility with other clients, host and port | 624 | non-standard-compliant news clients, the @code{url} library allows |
| 493 | fields may be included in news URLs though they are properly only | 625 | host and port fields to be included in @code{news} URLs, even though |
| 494 | allowed for nntp an snews. | 626 | they are properly only allowed for @code{nntp} and @code{snews}. |
| 627 | |||
| 628 | @code{news} and @code{nntp} URLs have the following form: | ||
| 495 | 629 | ||
| 496 | @table @samp | 630 | @table @samp |
| 497 | @item news:@var{newsgroup} | 631 | @item news:@var{newsgroup} |
| @@ -506,24 +640,22 @@ Retrieves a list of all available newsgroups; | |||
| 506 | Similar to the @samp{news} versions. | 640 | Similar to the @samp{news} versions. |
| 507 | @end table | 641 | @end table |
| 508 | 642 | ||
| 509 | @samp{:@var{port}} is optional and defaults to :119. | 643 | The default port for @code{nntp} (and @code{news}) is 119. The |
| 510 | 644 | difference between an @code{nntp} URL and a @code{news} URL is that an | |
| 511 | @samp{snews} is the same as @samp{nntp} except that the default port | 645 | @code{nttp} URL may specify an article by its number. The |
| 512 | is :563. | 646 | @samp{snews} scheme is the same as @samp{nntp}, except that it is |
| 513 | @cindex SSL | 647 | tunneled through SSL and has default port 563. |
| 514 | (It is tunneled through SSL.) | ||
| 515 | 648 | ||
| 516 | An @samp{nntp} URL is the same as a news URL, except that the URL may | 649 | These URLs are retrieved via the Gnus package. |
| 517 | specify an article by its number. | ||
| 518 | 650 | ||
| 519 | @defopt url-news-server | ||
| 520 | This variable can be used to override the default news server. | ||
| 521 | Usually this will be set by the Gnus package, which is used to fetch | ||
| 522 | news. | ||
| 523 | @cindex environment variable | 651 | @cindex environment variable |
| 524 | @vindex NNTPSERVER | 652 | @vindex NNTPSERVER |
| 525 | It may be set from the conventional environment variable | 653 | @defopt url-news-server |
| 526 | @code{NNTPSERVER}. | 654 | This variable specifies the default news server from which to fetch |
| 655 | news, if no server was specified in the URL. The default value, | ||
| 656 | @code{nil}, means to use the server specified by the standard | ||
| 657 | environment variable @samp{NNTPSERVER}, or @samp{news} if that | ||
| 658 | environment variable is unset. | ||
| 527 | @end defopt | 659 | @end defopt |
| 528 | 660 | ||
| 529 | @node rlogin/telnet/tn3270 | 661 | @node rlogin/telnet/tn3270 |
| @@ -534,12 +666,15 @@ It may be set from the conventional environment variable | |||
| 534 | @cindex terminal emulation | 666 | @cindex terminal emulation |
| 535 | @findex terminal-emulator | 667 | @findex terminal-emulator |
| 536 | 668 | ||
| 537 | These URL schemes from RFC 1738 for logon via a terminal emulator have | 669 | These URL schemes are defined in RFC 1738, and are used for logging in |
| 538 | the form | 670 | via a terminal emulator. They have the form |
| 671 | |||
| 539 | @example | 672 | @example |
| 540 | telnet://@var{user}:@var{password}@@@var{host}:@var{port} | 673 | telnet://@var{user}:@var{password}@@@var{host}:@var{port} |
| 541 | @end example | 674 | @end example |
| 542 | but the @code{:@var{password}} component is ignored. | 675 | |
| 676 | @noindent | ||
| 677 | but the @var{password} component is ignored. | ||
| 543 | 678 | ||
| 544 | To handle rlogin, telnet and tn3270 URLs, a @code{rlogin}, | 679 | To handle rlogin, telnet and tn3270 URLs, a @code{rlogin}, |
| 545 | @code{telnet} or @code{tn3270} (the program names and arguments are | 680 | @code{telnet} or @code{tn3270} (the program names and arguments are |
| @@ -553,39 +688,43 @@ Well-known ports are used if the URL does not specify a port. | |||
| 553 | @cindex ZEN IRC | 688 | @cindex ZEN IRC |
| 554 | @cindex ERC | 689 | @cindex ERC |
| 555 | @cindex rcirc | 690 | @cindex rcirc |
| 556 | @c Fixme: reference (was http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt) | 691 | |
| 557 | @dfn{Internet Relay Chat} (IRC) is handled by handing off the @sc{irc} | 692 | The @code{irc} scheme is defined in the Internet Draft at |
| 558 | session to a function named in @code{url-irc-function}. | 693 | @url{http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt} (which |
| 694 | was never approved as an RFC). Such URLs have the form | ||
| 695 | |||
| 696 | @example | ||
| 697 | irc://@var{host}:@var{port}/@var{target},@var{needpass} | ||
| 698 | @end example | ||
| 699 | |||
| 700 | @noindent | ||
| 701 | and are retrieved by opening an @acronym{IRC} session using the | ||
| 702 | function specified by @code{url-irc-function}. | ||
| 559 | 703 | ||
| 560 | @defopt url-irc-function | 704 | @defopt url-irc-function |
| 561 | A function to actually open an IRC connection. | 705 | The value of this option is a function, which is called to open an IRC |
| 562 | This function | 706 | connection for @code{irc} URLs. This function must take five |
| 563 | must take five arguments, @var{host}, @var{port}, @var{channel}, | 707 | arguments, @var{host}, @var{port}, @var{channel}, @var{user} and |
| 564 | @var{user} and @var{password}. The @var{channel} argument specifies the | 708 | @var{password}. The @var{channel} argument specifies the channel to |
| 565 | channel to join immediately, this can be @code{nil}. By default this is | 709 | join immediately, and may be @code{nil}. |
| 566 | @code{url-irc-rcirc}. | 710 | |
| 711 | The default is @code{url-irc-rcirc}, which uses the Rcirc package. | ||
| 712 | Other options are @code{url-irc-erc} (which uses ERC) and | ||
| 713 | @code{url-irc-zenirc} (which uses ZenIRC). | ||
| 567 | @end defopt | 714 | @end defopt |
| 568 | @defun url-irc-rcirc host port channel user password | ||
| 569 | Processes the arguments and lets @code{rcirc} handle the session. | ||
| 570 | @end defun | ||
| 571 | @defun url-irc-erc host port channel user password | ||
| 572 | Processes the arguments and lets @code{ERC} handle the session. | ||
| 573 | @end defun | ||
| 574 | @defun url-irc-zenirc host port channel user password | ||
| 575 | Processes the arguments and lets @code{zenirc} handle the session. | ||
| 576 | @end defun | ||
| 577 | 715 | ||
| 578 | @node data | 716 | @node data |
| 579 | @section data | 717 | @section data |
| 580 | @cindex data URLs | 718 | @cindex data URLs |
| 581 | 719 | ||
| 720 | The @code{data} scheme, defined in RFC 2397, contains MIME data in | ||
| 721 | the URL itself. Such URLs have the form | ||
| 722 | |||
| 582 | @example | 723 | @example |
| 583 | data:@r{[}@var{media-type}@r{]}@r{[};@var{base64}@r{]},@var{data} | 724 | data:@r{[}@var{media-type}@r{]}@r{[};@var{base64}@r{]},@var{data} |
| 584 | @end example | 725 | @end example |
| 585 | 726 | ||
| 586 | Data URLs contain MIME data in the URL itself. They are defined in | 727 | @noindent |
| 587 | RFC 2397. | ||
| 588 | |||
| 589 | @var{media-type} is a MIME @samp{Content-Type} string, possibly | 728 | @var{media-type} is a MIME @samp{Content-Type} string, possibly |
| 590 | including parameters. It defaults to | 729 | including parameters. It defaults to |
| 591 | @samp{text/plain;charset=US-ASCII}. The @samp{text/plain} can be | 730 | @samp{text/plain;charset=US-ASCII}. The @samp{text/plain} can be |
| @@ -598,14 +737,14 @@ present, the @var{data} are base64-encoded. | |||
| 598 | @cindex Network File System | 737 | @cindex Network File System |
| 599 | @cindex automounter | 738 | @cindex automounter |
| 600 | 739 | ||
| 740 | The @code{nfs} scheme, defined in RFC 2224, is similar to @code{ftp} | ||
| 741 | except that it points to a file on a remote host that is handled by an | ||
| 742 | NFS automounter on the local host. Such URLs have the form | ||
| 743 | |||
| 601 | @example | 744 | @example |
| 602 | nfs://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} | 745 | nfs://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} |
| 603 | @end example | 746 | @end example |
| 604 | 747 | ||
| 605 | The @samp{nfs:} scheme is defined in RFC 2224. It is similar to | ||
| 606 | @samp{ftp:} except that it points to a file on a remote host that is | ||
| 607 | handled by the automounter on the local host. | ||
| 608 | |||
| 609 | @defvar url-nfs-automounter-directory-spec | 748 | @defvar url-nfs-automounter-directory-spec |
| 610 | @end defvar | 749 | @end defvar |
| 611 | A string saying how to invoke the NFS automounter. Certain @samp{%} | 750 | A string saying how to invoke the NFS automounter. Certain @samp{%} |
| @@ -628,15 +767,6 @@ A literal @samp{%}. | |||
| 628 | 767 | ||
| 629 | Each can be used any number of times. | 768 | Each can be used any number of times. |
| 630 | 769 | ||
| 631 | @node cid | ||
| 632 | @section cid | ||
| 633 | @cindex Content-ID | ||
| 634 | |||
| 635 | RFC 2111 | ||
| 636 | |||
| 637 | @node about | ||
| 638 | @section about | ||
| 639 | |||
| 640 | @node ldap | 770 | @node ldap |
| 641 | @section ldap | 771 | @section ldap |
| 642 | @cindex LDAP | 772 | @cindex LDAP |
| @@ -644,50 +774,21 @@ RFC 2111 | |||
| 644 | 774 | ||
| 645 | The LDAP scheme is defined in RFC 2255. | 775 | The LDAP scheme is defined in RFC 2255. |
| 646 | 776 | ||
| 647 | @node imap | ||
| 648 | @section imap | ||
| 649 | @cindex IMAP | ||
| 650 | |||
| 651 | RFC 2192 | ||
| 652 | |||
| 653 | @node man | 777 | @node man |
| 654 | @section man | 778 | @section man |
| 655 | @cindex @command{man} | 779 | @cindex @command{man} |
| 656 | @cindex Unix man pages | 780 | @cindex Unix man pages |
| 657 | @findex man | 781 | @findex man |
| 658 | 782 | ||
| 783 | The @code{man} scheme is a non-standard one. Such URLs have the form | ||
| 784 | |||
| 659 | @example | 785 | @example |
| 660 | @samp{man:@var{page-spec}} | 786 | @samp{man:@var{page-spec}} |
| 661 | @end example | 787 | @end example |
| 662 | 788 | ||
| 663 | This is a non-standard scheme. @var{page-spec} is passed directly to | 789 | @noindent |
| 664 | the Lisp @code{man} function. | 790 | and are retrieved by passing @var{page-spec} to the Lisp function |
| 665 | 791 | @code{man}. | |
| 666 | @node Defining New URLs | ||
| 667 | @chapter Defining New URLs | ||
| 668 | |||
| 669 | @menu | ||
| 670 | * Naming conventions:: | ||
| 671 | * Required functions:: | ||
| 672 | * Optional functions:: | ||
| 673 | * Asynchronous fetching:: | ||
| 674 | * Supporting file-name-handlers:: | ||
| 675 | @end menu | ||
| 676 | |||
| 677 | @node Naming conventions | ||
| 678 | @section Naming conventions | ||
| 679 | |||
| 680 | @node Required functions | ||
| 681 | @section Required functions | ||
| 682 | |||
| 683 | @node Optional functions | ||
| 684 | @section Optional functions | ||
| 685 | |||
| 686 | @node Asynchronous fetching | ||
| 687 | @section Asynchronous fetching | ||
| 688 | |||
| 689 | @node Supporting file-name-handlers | ||
| 690 | @section Supporting file-name-handlers | ||
| 691 | 792 | ||
| 692 | @node General Facilities | 793 | @node General Facilities |
| 693 | @chapter General Facilities | 794 | @chapter General Facilities |
| @@ -1108,11 +1209,9 @@ You can use this function to do completion of URLs from the history. | |||
| 1108 | @node Customization | 1209 | @node Customization |
| 1109 | @chapter Customization | 1210 | @chapter Customization |
| 1110 | 1211 | ||
| 1111 | @section Environment Variables | ||
| 1112 | |||
| 1113 | @cindex environment variables | 1212 | @cindex environment variables |
| 1114 | The following environment variables affect the library's operation at | 1213 | The following environment variables affect the @code{url} library's |
| 1115 | startup. | 1214 | operation at startup. |
| 1116 | 1215 | ||
| 1117 | @table @code | 1216 | @table @code |
| 1118 | @item TMPDIR | 1217 | @item TMPDIR |
| @@ -1122,10 +1221,21 @@ If this is defined, @var{url-temporary-directory} is initialized from | |||
| 1122 | it. | 1221 | it. |
| 1123 | @end table | 1222 | @end table |
| 1124 | 1223 | ||
| 1125 | @section General User Options | 1224 | The following user options affect the general operation of |
| 1225 | @code{url} library. | ||
| 1126 | 1226 | ||
| 1127 | The following user options, settable with Customize, affect the | 1227 | @defopt url-configuration-directory |
| 1128 | general operation of the package. | 1228 | @cindex configuration files |
| 1229 | The value of this variable specifies the name of the directory where | ||
| 1230 | the @code{url} library stores its various configuration files, cache | ||
| 1231 | files, etc. | ||
| 1232 | |||
| 1233 | The default value specifies a subdirectory named @file{url/} in the | ||
| 1234 | standard Emacs user data directory specified by the variable | ||
| 1235 | @code{user-emacs-directory} (normally @file{~/.emacs.d}). However, | ||
| 1236 | the old default was @file{~/.url}, and this directory is used instead | ||
| 1237 | if it exists. | ||
| 1238 | @end defopt | ||
| 1129 | 1239 | ||
| 1130 | @defopt url-debug | 1240 | @defopt url-debug |
| 1131 | @cindex debugging | 1241 | @cindex debugging |