]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/text.texi
Remove prog-indentation-context
[gnu-emacs] / doc / lispref / text.texi
index f3679a88f74adc01f685838d76b77a40913848eb..6b93e51fc605393dc6c2354dd853f87dbfffaeb2 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-2015 Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1998-2016 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Text
 @chapter Text
@@ -303,7 +303,7 @@ there, the function returns @code{nil}.  Otherwise, a nearby symbol or
 word on the same line is acceptable.
 @end defun
 
-@defun thing-at-point thing
+@defun thing-at-point thing &optional no-properties
 Return the @var{thing} around or next to point, as a string.
 
 The argument @var{thing} is a symbol which specifies a kind of syntactic
@@ -311,6 +311,9 @@ entity.  Possibilities include @code{symbol}, @code{list}, @code{sexp},
 @code{defun}, @code{filename}, @code{url}, @code{word}, @code{sentence},
 @code{whitespace}, @code{line}, @code{page}, and others.
 
+When the optional argument @var{no-properties} is non-@code{nil}, this
+function strips text properties from the return value.
+
 @example
 ---------- Buffer: foo ----------
 Gentlemen may cry ``Pea@point{}ce! Peace!,''
@@ -804,7 +807,7 @@ A blank line is defined as a line containing only tabs and spaces.
 @code{delete-blank-lines} returns @code{nil}.
 @end deffn
 
-@deffn Command delete-trailing-whitespace start end
+@deffn Command delete-trailing-whitespace &optional start end
 Delete trailing whitespace in the region defined by @var{start} and
 @var{end}.
 
@@ -1763,7 +1766,7 @@ is value of @code{indent-line-function} in Paragraph-Indent Text mode.
 
 @defopt left-margin
 This variable specifies the base left margin column.  In Fundamental
-mode, @kbd{RET} indents to this column.  This variable automatically
+mode, @key{RET} indents to this column.  This variable automatically
 becomes buffer-local when set in any fashion.
 @end defopt
 
@@ -2362,83 +2365,6 @@ already indented, it calls @code{completion-at-point} to complete the
 text at point (@pxref{Completion in Buffers}).
 @end defopt
 
-@cindex literate programming
-@cindex multi-mode indentation
-  Some major modes need to support embedded regions of text whose
-syntax belongs to a different major mode.  Examples include
-@dfn{literate programming} source files that combine documentation and
-snippets of source code, Yacc/Bison programs that include snippets of
-plain C code, etc.  To correctly indent the embedded chunks, the major
-mode needs to delegate the indentation to another mode's indentation
-engine (e.g., call @code{c-indent-defun} for C code or
-@code{python-indent-line} for Python), while providing it with some
-context to guide the indentation.  The following facilities support
-such multi-mode indentation.
-
-@defvar prog-indentation-context
-This variable, when non-@code{nil}, holds the indentation context for
-the sub-mode's indentation engine provided by the superior major mode.
-The value should be a list of the form @code{(@var{first-column}
-@w{(@var{start} . @var{end})} @code{prev-chunk})}.  The members of the
-list have the following meaning:
-
-@table @var
-@item first-column
-The column to be used for top-level constructs.  This replaces the
-default value of the top-level column used by the sub-mode, usually
-zero.
-@item start
-@itemx end
-The region of the code chunk to be indented by the sub-mode.  The
-value of @var{end} can be @code{nil}, which stands for the value of
-@code{point-max}.
-@item prev-chunk
-If this is non-@code{nil}, it should provide the sub-mode's
-indentation engine with a virtual context of the code chunk.  Valid
-values include:
-
-@itemize @minus
-@item
-A string whose contents is the text the sub-mode's indentation engine
-should consider to precede the code chunk.  The sub-mode's indentation
-engine can add text properties to that string, to be reused in
-repeated calls with the same string, thus using it as a cache.  An
-example where this is useful is code chunks that need to be indented
-as function bodies, but lack the function's preamble---the string
-could then include that missing preamble.
-@item
-A function.  It is expected to be called with the start position of
-the current chunk, and should return a cons cell
-@w{@code{(@var{prev-start} . @var{prev-end})}} that specifies the
-region of the previous code chunk, or @code{nil} if there is no previous
-chunk.  This is useful in literate-programming sources, where code is
-split into chunks, and correct indentation needs to access previous
-chunks.
-@end itemize
-@end table
-@end defvar
-
-The following convenience functions should be used by major mode's
-indentation engine in support of invocations as sub-modes of another
-major mode.
-
-@defun prog-first-column
-Call this function instead of using a literal value (usually, zero) of
-the column number for indenting top-level program constructs.  The
-function's value is the column number to use for top-level constructs.
-When no superior mode is in effect, this function returns zero.
-@end defun
-
-@defun prog-widen
-Call this function instead of @code{widen} to remove any restrictions
-imposed by the mode's indentation engine and restore the restrictions
-recorded in @code{prog-indentation-context}.  This prevents the
-indentation engine of a sub-mode from inadvertently operating on text
-outside of the chunk it was supposed to indent, and preserves the
-restriction imposed by the superior mode.  When no superior mode is in
-effect, this function just calls @code{widen}.
-@end defun
-
 
 @node Region Indent
 @subsection Indenting an Entire Region
@@ -3380,14 +3306,22 @@ If consecutive characters have unequal non-@code{nil}
 @code{intangible} properties, they belong to separate groups; each
 group is separately treated as described above.
 
-When the variable @code{inhibit-point-motion-hooks} is non-@code{nil},
-the @code{intangible} property is ignored.
+When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}
+(as it is by default), the @code{intangible} property is ignored.
 
 Beware: this property operates at a very low level, and affects a lot of code
 in unexpected ways.  So use it with extreme caution.  A common misuse is to put
 an intangible property on invisible text, which is actually unnecessary since
 the command loop will move point outside of the invisible text at the end of
-each command anyway.  @xref{Adjusting Point}.
+each command anyway.  @xref{Adjusting Point}.  For these reasons, this
+property is obsolete; use the @code{cursor-intangible} property instead.
+
+@item cursor-intangible
+@kindex cursor-intangible @r{(text property)}
+@findex cursor-intangible-mode
+When the minor mode @code{cursor-intangible-mode} is turned on, point
+is moved away of any position that has a non-@code{nil}
+@code{cursor-intangible} property, just before redisplay happens.
 
 @item field
 @kindex field @r{(text property)}
@@ -3550,9 +3484,23 @@ It is possible to use @code{char-after} to examine characters at various
 buffer positions without moving point to those positions.  Only an
 actual change in the value of point runs these hook functions.
 
-The variable @code{inhibit-point-motion-hooks} can inhibit running the
-@code{point-left} and @code{point-entered} hooks, see @ref{Inhibit
-point motion hooks}.
+The variable @code{inhibit-point-motion-hooks} by default inhibits
+running the @code{point-left} and @code{point-entered} hooks, see
+@ref{Inhibit point motion hooks}.
+
+These properties are obsolete; please use
+@code{cursor-sensor-functions} instead.
+
+@item cursor-sensor-functions
+@kindex cursor-sensor-functions @r{(text property)}
+@findex cursor-sensor-mode
+This special property records a list of functions that react to cursor
+motion.  Each function in the list is called, just before redisplay,
+with 3 arguments: the affected window, the previous known position of
+the cursor, and one of the symbols @code{entered} or @code{left},
+depending on whether the cursor is entering the text that has this
+property or leaving it.  The functions are called only when the minor
+mode @code{cursor-sensor-mode} is turned on.
 
 @item composition
 @kindex composition @r{(text property)}
@@ -3564,10 +3512,12 @@ directly by, for instance, @code{put-text-property}.
 @end table
 
 @defvar inhibit-point-motion-hooks
-@anchor{Inhibit point motion hooks} When this variable is
+@anchor{Inhibit point motion hooks} When this obsolete variable is
 non-@code{nil}, @code{point-left} and @code{point-entered} hooks are
 not run, and the @code{intangible} property has no effect.  Do not set
-this variable globally; bind it with @code{let}.
+this variable globally; bind it with @code{let}.  Since the affected
+properties are obsolete, this variable's default value is @code{t}, to
+effectively disable them.
 @end defvar
 
 @defvar show-help-function