emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107178: * doc/lispref/loading.texi (


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107178: * doc/lispref/loading.texi (Named Features): Update the require example.
Date: Tue, 07 Feb 2012 21:29:16 -0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107178
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2012-02-07 21:29:16 -0800
message:
  * doc/lispref/loading.texi (Named Features): Update the require example.
  The new one reflects the current code, and has a bonus free example
  of lets + requires too.
modified:
  doc/lispref/ChangeLog
  doc/lispref/loading.texi
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2012-02-07 08:26:54 +0000
+++ b/doc/lispref/ChangeLog     2012-02-08 05:29:16 +0000
@@ -1,3 +1,7 @@
+2012-02-08  Glenn Morris  <address@hidden>
+
+       * loading.texi (Named Features): Update the require example.
+
 2012-02-07  Glenn Morris  <address@hidden>
 
        * modes.texi (Defining Minor Modes):

=== modified file 'doc/lispref/loading.texi'
--- a/doc/lispref/loading.texi  2012-01-19 07:21:25 +0000
+++ b/doc/lispref/loading.texi  2012-02-08 05:29:16 +0000
@@ -696,23 +696,29 @@
 file should call @code{provide} at the top level to add the feature to
 @code{features}; if it fails to do so, @code{require} signals an error.
 
-  For example, in @file{emacs/lisp/prolog.el},
-the definition for @code{run-prolog} includes the following code:
+  For example, in @file{idlwave.el}, the definition for
address@hidden includes the following code:
 
 @smallexample
-(defun run-prolog ()
-  "Run an inferior Prolog process, with I/O via buffer *prolog*."
-  (interactive)
-  (require 'comint)
-  (switch-to-buffer (make-comint "prolog" prolog-program-name))
-  (inferior-prolog-mode))
+(defun idlwave-complete-filename ()
+  "Use the comint stuff to complete a file name."
+   (require 'comint)
+   (let* ((comint-file-name-chars "~/A-Za-z0-9+@:address@hidden@}\\-")
+          (comint-completion-addsuffix nil)
+          ...)
+       (comint-dynamic-complete-filename)))
 @end smallexample
 
 @noindent
 The expression @code{(require 'comint)} loads the file @file{comint.el}
-if it has not yet been loaded.  This ensures that @code{make-comint} is
-defined.  Features are normally named after the files that provide them,
-so that @code{require} need not be given the file name.
+if it has not yet been loaded, ensuring that
address@hidden is defined.  Features are
+normally named after the files that provide them, so that
address@hidden need not be given the file name.  (Note that it is
+important that the @code{require} statement be outside the body of the
address@hidden  Loading a library while its variables are let-bound can
+have unintended consequences, namely the variables becoming unbound
+after the let exits.)
 
 The @file{comint.el} file contains the following top-level expression:
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]