all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Moving octave-mode manual from GNU Octave to GNU Emacs.
@ 2013-11-21 16:36 Rüdiger Sonderfeld
  2013-11-21 17:36 ` Rüdiger Sonderfeld
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Rüdiger Sonderfeld @ 2013-11-21 16:36 UTC (permalink / raw)
  To: emacs-devel

Hello,

octave-mode seemed to have been maintained both in GNU Octave and in 
GNU Emacs for a while.  The Emacs code has been removed from GNU Octave 
(10856:dea165ff6d74) and it is now only maintained in GNU Emacs.  But the 
octave-mode manual is still part of GNU Octave 
http://hg.savannah.gnu.org/hgweb/octave/file/1d58abc740c0/doc/interpreter/emacs.txi

It is not included in GNU Emacs and it is partially outdated.  The GNU Octave 
maintainers want to get rid of it and since octave-mode is maintained within 
GNU Emacs it makes sense to move it to GNU Emacs.

It currently says "Copyright (C) 1996-2013 Kurt Hornik".  I have contacted him 
and he agreed to change the copyright to the FSF.  What is the correct 
procedure for this?

(Since he is the original author of octave-mode, I assume he has already 
signed the fsf papers.)

Regards,
Rüdiger




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Moving octave-mode manual from GNU Octave to GNU Emacs.
  2013-11-21 16:36 Moving octave-mode manual from GNU Octave to GNU Emacs Rüdiger Sonderfeld
@ 2013-11-21 17:36 ` Rüdiger Sonderfeld
  2013-11-22  1:38   ` Stefan Monnier
  2013-11-21 18:53 ` Glenn Morris
  2013-12-06 22:50 ` [PATCH] Import `octave-mode' manual from GNU Octave Rüdiger Sonderfeld
  2 siblings, 1 reply; 12+ messages in thread
From: Rüdiger Sonderfeld @ 2013-11-21 17:36 UTC (permalink / raw)
  To: emacs-devel

On Thursday 21 November 2013 17:36:55 Rüdiger Sonderfeld wrote:
> It currently says "Copyright (C) 1996-2013 Kurt Hornik".  I have contacted
> him and he agreed to change the copyright to the FSF.  What is the correct
> procedure for this?

I have checked the file history in GNU Octave and besides the original import 
from Kurt Hornik it only seems to contain minor changes from

* John W. Eaton (has signed the fsf papers for Emacs)
* Rik <rik@octave.org>
* Rafael Laboissiere  <rafael@debian.org>

Regards,
Rüdiger




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Moving octave-mode manual from GNU Octave to GNU Emacs.
  2013-11-21 16:36 Moving octave-mode manual from GNU Octave to GNU Emacs Rüdiger Sonderfeld
  2013-11-21 17:36 ` Rüdiger Sonderfeld
@ 2013-11-21 18:53 ` Glenn Morris
  2013-11-21 20:16   ` Rüdiger Sonderfeld
  2013-12-06 22:50 ` [PATCH] Import `octave-mode' manual from GNU Octave Rüdiger Sonderfeld
  2 siblings, 1 reply; 12+ messages in thread
From: Glenn Morris @ 2013-11-21 18:53 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: emacs-devel

Rüdiger Sonderfeld wrote:

> (Since he is the original author of octave-mode, I assume he has already 
> signed the fsf papers.)

You can't assume this, because it often seems to have happened in the
past that people assigned specific things rather than doing a blanket
assignment for "Emacs" (which would still only cover things they
explicitly wanted to contribute). And indeed the relevant entry in the
copyright.list file only says "Assigns octave.el and future changes.".
Does this include any associated manual? I dunno. It probably does, but
to be safe, I would suggest you ask assign@gnu for a definitive answer.
(Eg it seems slightly odd that the manual isn't in Emacs until now.)

> it only seems to contain minor changes from
>
> * John W. Eaton (has signed the fsf papers for Emacs)
> * Rik <address@hidden>
> * Rafael Laboissiere  <address@hidden>

Sounds like only the last two are potentially an issue.
(Though same comment as above for the first one.)
If "minor changes" means "less than ~ 15 lines worth of text from each
author remains in the latest version of the file", then there's no issue
here.


(Thanks for working on this, it definitely sounds like a good thing.)



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Moving octave-mode manual from GNU Octave to GNU Emacs.
  2013-11-21 18:53 ` Glenn Morris
@ 2013-11-21 20:16   ` Rüdiger Sonderfeld
  2013-11-22  3:01     ` Glenn Morris
  0 siblings, 1 reply; 12+ messages in thread
From: Rüdiger Sonderfeld @ 2013-11-21 20:16 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

Hello Glenn,

On Thursday 21 November 2013 13:53:20 Glenn Morris wrote:
> You can't assume this, because it often seems to have happened in the
> past that people assigned specific things rather than doing a blanket
> assignment for "Emacs" (which would still only cover things they
> explicitly wanted to contribute). And indeed the relevant entry in the
> copyright.list file only says "Assigns octave.el and future changes.".
> Does this include any associated manual? I dunno. It probably does, but
> to be safe, I would suggest you ask assign@gnu for a definitive answer.

Isn't fsf-records@gnu the address for such questions?

> (Eg it seems slightly odd that the manual isn't in Emacs until now.)

I've asked John W. Eaton (the GNU Octave maintainer) if there was a reason why 
the manual wasn't moved to Emacs and he couldn't think of any.

> Sounds like only the last two are potentially an issue.
> (Though same comment as above for the first one.)
> If "minor changes" means "less than ~ 15 lines worth of text from each
> author remains in the latest version of the file", then there's no issue
> here.

That's the change contributed by Rafael.

http://hg.savannah.gnu.org/hgweb/octave/rev/a441d6681364#l5.1

It changes 3 lines.

Rik seems to have contributed more than 15 lines though.

# hg churn -t '{author}' doc/interpreter/emacs.txi
jwe                               595
Rik <octave@nomad.inbox5.com>      34
Rik <rik@octave.org>               14
John W. Eaton <jwe@octave.org>     13
Rik <rdrider0-list@yahoo.com>       8

(56 lines)

I'll contact him to check if he has signed the fsf papers or is willing to do 
so.

Regards,
Rüdiger




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Moving octave-mode manual from GNU Octave to GNU Emacs.
  2013-11-21 17:36 ` Rüdiger Sonderfeld
@ 2013-11-22  1:38   ` Stefan Monnier
  2013-11-22  1:59     ` Rüdiger Sonderfeld
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2013-11-22  1:38 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: emacs-devel

>> It currently says "Copyright (C) 1996-2013 Kurt Hornik".  I have contacted
>> him and he agreed to change the copyright to the FSF.  What is the correct
>> procedure for this?

The one you're following.  Indeed Kurt's changes are already covered.

> * John W. Eaton (has signed the fsf papers for Emacs)

Yup.

> * Rik <rik@octave.org>
> * Rafael Laboissiere  <rafael@debian.org>

For Rik's changes, you might like to take a closer look at them, in case
some of his later changes supersede text he had contributed in earlier
changes, or have been superseded by other text.  Or in case some of the
changes are "re-fill" (a pretty common occurrence in such text files).

But if he can be found and is willing to assign his copyright, it's even
better,


        Stefan



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Moving octave-mode manual from GNU Octave to GNU Emacs.
  2013-11-22  1:38   ` Stefan Monnier
@ 2013-11-22  1:59     ` Rüdiger Sonderfeld
  2013-11-22  2:44       ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Rüdiger Sonderfeld @ 2013-11-22  1:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Thursday 21 November 2013 20:38:08 Stefan Monnier wrote:
> >> It currently says "Copyright (C) 1996-2013 Kurt Hornik".  I have
> >> contacted
> >> him and he agreed to change the copyright to the FSF.  What is the
> >> correct
> >> procedure for this?
> 
> The one you're following.  Indeed Kurt's changes are already covered.

He confirmed his willingness to change the copyright in a private e-mail.  I 
guess that's not enough to simply change it and commit it to Emacs.  Does he 
have to sign additional papers or is it enough if he makes a public statement 
or contributes the diff?

> For Rik's changes, you might like to take a closer look at them, in case
> some of his later changes supersede text he had contributed in earlier
> changes, or have been superseded by other text.  Or in case some of the
> changes are "re-fill" (a pretty common occurrence in such text files).
> 
> But if he can be found and is willing to assign his copyright, it's even
> better,

I've contacted him.  Most of his changes are whitespace fixes.  I've counted 
only 9 line changes which change actual content.  Of which at least 4 are no 
longer in my updated version.  So maybe an assignment isn't even needed?

Regards,
Rüdiger




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Moving octave-mode manual from GNU Octave to GNU Emacs.
  2013-11-22  1:59     ` Rüdiger Sonderfeld
@ 2013-11-22  2:44       ` Stefan Monnier
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2013-11-22  2:44 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: emacs-devel

>> The one you're following.  Indeed Kurt's changes are already covered.
> He confirmed his willingness to change the copyright in a private
> e-mail.  I  guess that's not enough to simply change it and commit it
> to Emacs.  Does he  have to sign additional papers or is it enough if
> he makes a public statement  or contributes the diff?

His paperwork already covers all changes he contributes to Emacs.
So his saying (over email) that he wants it in Emacs is sufficient.

> So maybe an assignment isn't even needed?

Indeed.


        Stefan



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Moving octave-mode manual from GNU Octave to GNU Emacs.
  2013-11-21 20:16   ` Rüdiger Sonderfeld
@ 2013-11-22  3:01     ` Glenn Morris
  0 siblings, 0 replies; 12+ messages in thread
From: Glenn Morris @ 2013-11-22  3:01 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: emacs-devel

Rüdiger Sonderfeld wrote:

>> to be safe, I would suggest you ask assign@gnu for a definitive answer.
>
> Isn't fsf-records@gnu the address for such questions?

They are aliases.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] Import `octave-mode' manual from GNU Octave.
  2013-11-21 16:36 Moving octave-mode manual from GNU Octave to GNU Emacs Rüdiger Sonderfeld
  2013-11-21 17:36 ` Rüdiger Sonderfeld
  2013-11-21 18:53 ` Glenn Morris
@ 2013-12-06 22:50 ` Rüdiger Sonderfeld
  2013-12-07  8:31   ` Eli Zaretskii
  2 siblings, 1 reply; 12+ messages in thread
From: Rüdiger Sonderfeld @ 2013-12-06 22:50 UTC (permalink / raw)
  To: emacs-devel

If this is acceptable I'll push it to trunk.  I'm not sure if I should
put Kurt Hornik as the author of the change.

Regards,
Rüdiger

-- 8< ------------------------------------------------------------- >8 --

The manual was written by Kurt Hornik.  He agreed to assign the
copyright for it to the FSF.  I have updated and modified the manual.

* doc/misc/octave-mode.texi: Imported from GNU Octave
  (doc/interpreter/emacs.txi).
* doc/misc/Makefile.in: Add octave-mode.texi.
---
 ChangeLog                 |   6 +
 doc/misc/Makefile.in      |  27 ++-
 doc/misc/octave-mode.texi | 530 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 555 insertions(+), 8 deletions(-)
 create mode 100644 doc/misc/octave-mode.texi

diff --git a/ChangeLog b/ChangeLog
index 01c16d0..209eba9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-06  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
+
+	* doc/misc/octave-mode.texi: Imported from GNU Octave
+	  (doc/interpreter/emacs.txi).
+	* doc/misc/Makefile.in: Add octave-mode.texi.
+
 2013-12-01  Dmitry Gutov  <dgutov@yandex.ru>
 
 	* .dir-locals.el (log-edit-move): Add the "Author: " header.
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 70fb05e..869f2fd 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -63,14 +63,13 @@ MAKEINFO_OPTS = --force -I$(emacsdir)
 DOCMISC_W32 = @DOCMISC_W32@
 
 ## Info files to build and install on all platforms.
-INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl \
-	dbus dired-x ebrowse ede ediff edt eieio \
-	emacs-mime epa erc ert eshell eudc efaq \
-	flymake forms gnus emacs-gnutls htmlfontify idlwave ido info.info \
-	mairix-el message mh-e newsticker nxml-mode \
-	org pcl-cvs pgg rcirc remember reftex sasl \
-	sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \
-	url vip viper widget wisent woman
+INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl dbus		\
+	dired-x ebrowse ede ediff edt eieio emacs-mime epa erc ert	\
+	eshell eudc efaq flymake forms gnus emacs-gnutls htmlfontify	\
+	idlwave ido info.info mairix-el message mh-e newsticker		\
+	nxml-mode octave-mode org pcl-cvs pgg rcirc remember reftex	\
+	sasl sc semantic ses sieve smtpmail speedbar srecode		\
+	todo-mode tramp url vip viper widget wisent woman
 
 ## Info files to install on current platform.
 INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_INFO_W32)
@@ -564,6 +563,18 @@ nxml-mode.pdf: $(nxml_mode_deps)
 nxml-mode.html: $(nxml_mode_deps)
 	$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/nxml-mode.texi
 
+octave_mode-deps = ${srcdir}/octave-mode.texi ${gfdl}
+octave-mode : $(buildinfodir)/octave-mode$(INFO_EXT)
+$(buildinfodir)/octave-mode$(INFO_EXT): $(octave_deps)
+	$(mkinfodir)
+	$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/octave-mode.texi
+octave-mode.dvi: $(octave_mode_deps)
+	$(ENVADD) $(TEXI2DVI) ${srcdir}/octave-mode.texi
+octave-mode.pdf: $(octave_mode_deps)
+	$(ENVADD) $(TEXI2PDF) ${srcdir}/octave-mode.texi
+octave-mode.html: $(octave_mode_deps)
+	$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/octave-mode.texi
+
 org_deps = ${srcdir}/org.texi ${gfdl}
 org : $(buildinfodir)/org$(INFO_EXT)
 $(buildinfodir)/org$(INFO_EXT): $(org_deps)
diff --git a/doc/misc/octave-mode.texi b/doc/misc/octave-mode.texi
new file mode 100644
index 0000000..d9efd28
--- /dev/null
+++ b/doc/misc/octave-mode.texi
@@ -0,0 +1,530 @@
+\input texinfo                  @c -*-texinfo-*-
+@c %**start of header
+@setfilename ../../info/octave-mode
+@settitle Octave Mode
+@c %**end of header
+
+@c copied from GNU Octave's macros.texi.
+@c The following macro works around the Info/plain text expansion of @code{XXX}
+@c which is `XXX'.  This looks particularly bad when the macro body is
+@c single or double-quoted text, such as a property value `"position"'
+@ifinfo
+@macro qcode{arg}
+\arg\
+@end macro
+@end ifinfo
+@ifnotinfo
+@macro qcode{arg}
+@code{\arg\}
+@end macro
+@end ifnotinfo
+
+@copying
+Copyright @copyright{} 1996--2013 Free Software Foundation, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
+and with the Back-Cover Texts as in (a) below.  A copy of the license
+is included in the section entitled ``GNU Free Documentation License.''
+
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual.''
+@end quotation
+@end copying
+
+@dircategory Emacs editing modes
+@direntry
+* Octave mode: (octave-mode).         Emacs mode for editing GNU Octave files.
+@end direntry
+
+@finalout
+
+@titlepage
+@title Octave Mode
+@subtitle An Emacs mode for programming in GNU Octave
+
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@contents
+
+@ifnottex
+@node Top
+@top Octave Mode
+
+@insertcopying
+@end ifnottex
+
+@menu
+* Overview::
+* Using Octave Mode::
+* Running Octave from Within Emacs::
+@c * Using the Emacs Info Reader for Octave::
+* Index::
+@end menu
+
+@node Overview
+@chapter Overview
+
+The development of Octave code can greatly be facilitated using Emacs
+with Octave mode, a major mode for editing Octave files which can e.g.@:
+automatically indent the code, do some of the typing (with Abbrev mode)
+and show keywords, comments, strings, etc.@: in different faces (with
+Font-lock mode on devices that support it).
+
+It is also possible to run Octave from within Emacs, either by directly
+entering commands at the prompt in a buffer in Inferior Octave mode, or
+by interacting with Octave from within a file with Octave code.  This is
+useful in particular for debugging Octave code.
+
+@node Using Octave Mode
+@chapter Using Octave Mode
+
+In Octave mode, the following special Emacs commands can be used in
+addition to the standard Emacs commands.
+
+@table @kbd
+@item C-h m
+Describe the features of Octave mode.
+
+@item LFD
+Reindent the current Octave line, insert a newline and indent the new
+line (@code{octave-reindent-then-newline-and-indent}).  An abbrev before
+point is expanded if @code{abbrev-mode} is non-@code{nil}.
+
+@item TAB
+Indents current Octave line based on its contents and on previous
+lines (@code{indent-according-to-mode}).
+
+@item ;
+Insert an ``electric'' semicolon (@code{octave-electric-semi}).  If
+@code{octave-auto-indent} is non-@code{nil}, reindent the current line.
+If @code{octave-auto-newline} is non-@code{nil}, automagically insert a
+newline and indent the new line.
+
+@item `
+Start entering an abbreviation (@code{octave-abbrev-start}).  If Abbrev
+mode is turned on, typing @kbd{`C-h} or @kbd{`?} lists all abbrevs.
+Any other key combination is executed normally.  Note that all Octave
+abbrevs start with a grave accent.
+
+@item M-LFD
+Break line at point and insert continuation marker and alignment
+(@code{octave-split-line}).
+
+@item M-TAB
+Perform completion on Octave symbol preceding point, comparing that
+symbol against Octave's reserved words and built-in variables
+(@code{octave-complete-symbol}).
+
+@item M-C-a
+Move backward to the beginning of a function
+(@code{octave-beginning-of-defun}).
+With prefix argument @var{N}, do it that many times if @var{N} is
+positive; otherwise, move forward to the @var{N}-th following beginning
+of a function.
+
+@item M-C-e
+Move forward to the end of a function (@code{octave-end-of-defun}).
+With prefix argument @var{N}, do it that many times if @var{N} is
+positive; otherwise, move back to the @var{N}-th preceding end of a
+function.
+
+@item M-C-h
+Puts point at beginning and mark at the end of the current Octave
+function, i.e., the one containing point or following point
+(@code{octave-mark-defun}).
+
+@item M-C-q
+Properly indents the Octave function which contains point
+(@code{octave-indent-defun}).
+
+@item M-;
+If there is no comment already on this line, create a code-level comment
+(started by two comment characters) if the line is empty, or an in-line
+comment (started by one comment character) otherwise
+(@code{octave-indent-for-comment}).
+Point is left after the start of the comment which is properly aligned.
+
+@item C-c ;
+Puts the comment character @samp{#} (more precisely, the string value of
+@code{octave-comment-start}) at the beginning of every line in the
+region (@code{octave-comment-region}).  With just @kbd{C-u} prefix
+argument, uncomment each line in the region.  A numeric prefix argument
+@var{N} means use @var{N} comment characters.
+
+@item C-c :
+Uncomments every line in the region (@code{octave-uncomment-region}).
+
+@item C-c C-p
+Move one line of Octave code backward, skipping empty and comment lines
+(@code{octave-previous-code-line}).  With numeric prefix argument
+@var{N}, move that many code lines backward (forward if @var{N} is
+negative).
+
+@item C-c C-n
+Move one line of Octave code forward, skipping empty and comment lines
+(@code{octave-next-code-line}).  With numeric prefix argument @var{N},
+move that many code lines forward (backward if @var{N} is negative).
+
+@item C-c C-a
+Move to the `real' beginning of the current line
+(@code{octave-beginning-of-line}).  If point is in an empty or comment
+line, simply go to its beginning; otherwise, move backwards to the
+beginning of the first code line which is not inside a continuation
+statement, i.e., which does not follow a code line ending in @samp{...}
+or @samp{\}, or is inside an open parenthesis list.
+
+@item C-c C-e
+Move to the `real' end of the current line (@code{octave-end-of-line}).
+If point is in a code line, move forward to the end of the first Octave
+code line which does not end in @samp{...} or @samp{\} or is inside an
+open parenthesis list.  Otherwise, simply go to the end of the current
+line.
+
+@item C-c M-C-n
+Move forward across one balanced begin-end block of Octave code
+(@code{octave-forward-block}).  With numeric prefix argument @var{N},
+move forward across @var{n} such blocks (backward if @var{N} is
+negative).
+
+@item C-c M-C-p
+Move back across one balanced begin-end block of Octave code
+(@code{octave-backward-block}).  With numeric prefix argument @var{N},
+move backward across @var{N} such blocks (forward if @var{N} is
+negative).
+
+@item C-c M-C-d
+Move forward down one begin-end block level of Octave code
+(@code{octave-down-block}).  With numeric prefix argument, do it that
+many times; a negative argument means move backward, but still go down
+one level.
+
+@item C-c M-C-u
+Move backward out of one begin-end block level of Octave code
+(@code{octave-backward-up-block}).  With numeric prefix argument, do it
+that many times; a negative argument means move forward, but still to a
+less deep spot.
+
+@item C-c M-C-h
+Put point at the beginning of this block, mark at the end
+(@code{octave-mark-block}).
+The block marked is the one that contains point or follows point.
+
+@item C-c ]
+Close the current block on a separate line (@code{octave-close-block}).
+An error is signaled if no block to close is found.
+
+@item C-c C-f
+Insert a function skeleton, prompting for the function's name, arguments
+and return values which have to be entered without parentheses
+(@code{octave-insert-defun}).
+
+@item C-c C-h
+Search the function, operator and variable indices of all info files
+with documentation for Octave for entries (@code{octave-help}).  If used
+interactively, the entry is prompted for with completion.  If multiple
+matches are found, one can cycle through them using the standard
+@samp{,} (@code{Info-index-next}) command of the Info reader.
+
+The variable @code{octave-help-files} is a list of files to search
+through and defaults to @qcode{'("octave")}.  If there is also an Octave
+Local Guide with corresponding info file, say, @file{octave-LG}, you can
+have @code{octave-help} search both files by
+@lisp
+(setq octave-help-files '("octave" "octave-LG"))
+@end lisp
+@noindent
+in one of your Emacs startup files.
+@end table
+
+A common problem is that the @key{RET} key does @emph{not} indent the
+line to where the new text should go after inserting the newline.  This
+is because the standard Emacs convention is that @key{RET} (aka
+@kbd{C-m}) just adds a newline, whereas @key{LFD} (aka @kbd{C-j}) adds a
+newline and indents it.  This is particularly inconvenient for users with
+keyboards which do not have a special @key{LFD} key at all; in such
+cases, it is typically more convenient to use @key{RET} as the @key{LFD}
+key (rather than typing @kbd{C-j}).
+
+You can make @key{RET} do this by adding
+@lisp
+(define-key octave-mode-map "\C-m"
+  'octave-reindent-then-newline-and-indent)
+@end lisp
+@noindent
+to one of your Emacs startup files.  Another, more generally applicable
+solution is
+@lisp
+(defun RET-behaves-as-LFD ()
+  (let ((x (key-binding "\C-j")))
+    (local-set-key "\C-m" x)))
+(add-hook 'octave-mode-hook 'RET-behaves-as-LFD)
+@end lisp
+@noindent
+(this works for all modes by adding to the startup hooks, without having
+to know the particular binding of @key{RET} in that mode!).  Similar
+considerations apply for using @key{M-RET} as @key{M-LFD}.  As Barry
+A. Warsaw @email{bwarsaw@@cnri.reston.va.us} says in the documentation for his
+@code{cc-mode}, ``This is a very common question.  @code{:-)} If you want
+this to be the default behavior, don't lobby me, lobby RMS!''
+
+The following variables can be used to customize Octave mode.
+
+@table @code
+@item octave-auto-indent
+Non-@code{nil} means auto-indent the current line after a semicolon or
+space.  Default is @code{nil}.
+
+@item octave-auto-newline
+Non-@code{nil} means auto-insert a newline and indent after semicolons
+are typed.  The default value is @code{nil}.
+
+@item octave-blink-matching-block
+Non-@code{nil} means show matching begin of block when inserting a space,
+newline or @samp{;} after an else or end keyword.  Default is @code{t}.
+This is an extremely useful feature for automatically verifying that the
+keywords match---if they don't, an error message is displayed.
+
+@item octave-block-offset
+Extra indentation applied to statements in block structures.
+Default is 2.
+
+@item octave-continuation-offset
+Extra indentation applied to Octave continuation lines.
+Default is 4.
+
+@item octave-continuation-string
+String used for Octave continuation lines.
+Normally @samp{\}.
+
+@item octave-font-lock-texinfo-comment
+Highlight texinfo comment blocks.  The default value is @code{t}.
+
+@end table
+
+If Font Lock mode is enabled, Octave mode will display
+
+@itemize @bullet
+@item
+strings in @code{font-lock-string-face}
+
+@item
+comments in @code{font-lock-comment-face}
+
+@item
+the Octave reserved words (such as all block keywords) and the text
+functions (such as @samp{cd} or @samp{who}) which are also reserved
+using @code{font-lock-keyword-face}
+
+@item
+the built-in operators (@samp{&&}, @samp{==}, @dots{}) using
+@code{font-lock-reference-face}
+
+@item
+and the function names in function declarations in
+@code{font-lock-function-name-face}.
+@end itemize
+
+There is also rudimentary support for Imenu (currently, function names
+can be indexed).
+
+@cindex TAGS
+@cindex Emacs TAGS files
+@cindex @code{octave-tags}
+You can generate TAGS files for Emacs from Octave @file{.m} files using
+the shell script @code{octave-tags} that is installed alongside your copy of
+Octave.
+
+Customization of Octave mode can be performed by modification of the
+variable @code{octave-mode-hook}.  If the value of this variable is
+non-@code{nil}, turning on Octave mode calls its value.
+
+If you discover a problem with Octave mode, you can conveniently send a
+bug report using @kbd{C-c C-b} (@code{octave-submit-bug-report}).  This
+automatically sets up a mail buffer with version information already
+added.  You just need to add a description of the problem, including a
+reproducible test case and send the message.
+
+@node Running Octave from Within Emacs
+@chapter Running Octave from Within Emacs
+
+The package @file{octave} provides commands for running an inferior
+Octave process in a special Emacs buffer.  Use
+@lisp
+M-x run-octave
+@end lisp
+@noindent
+to directly start an inferior Octave process.  If Emacs does not know
+about this command, add the line
+@lisp
+(autoload 'run-octave "octave-inf" nil t)
+@end lisp
+@noindent
+to your @file{.emacs} file.
+
+This will start Octave in a special buffer the name of which is
+specified by the variable @code{inferior-octave-buffer} and defaults to
+@qcode{"*Inferior Octave*"}.  From within this buffer, you can
+interact with the inferior Octave process `as usual', i.e., by entering
+Octave commands at the prompt.  The buffer is in Inferior Octave mode,
+which is derived from the standard Comint mode, a major mode for
+interacting with an inferior interpreter.  See the documentation for
+@code{comint-mode} for more details, and use @kbd{C-h b} to find out
+about available special keybindings.
+
+You can also communicate with an inferior Octave process from within
+files with Octave code (i.e., buffers in Octave mode), using the
+following commands.
+
+@table @kbd
+@item C-c C-i l
+Send the current line to the inferior Octave process
+(@code{octave-send-line}).
+With positive prefix argument @var{N}, send that many lines.
+If @code{octave-send-line-auto-forward} is non-@code{nil}, go to the
+next unsent code line.
+
+@item C-c C-i b
+Send the current block to the inferior Octave process
+(@code{octave-send-block}).
+
+@item C-c C-i f
+Send the current function to the inferior Octave process
+(@code{octave-send-defun}).
+
+@item C-c C-i r
+Send the region to the inferior Octave process
+(@code{octave-send-region}).
+
+@item C-c C-i a
+Send the entire buffer to the inferior Octave process
+(@code{octave-send-buffer}).
+
+@item C-c C-i s
+Make sure that `inferior-octave-buffer' is displayed
+(@code{octave-show-process-buffer}).
+
+@item C-c C-i q
+Delete all windows that display the inferior Octave buffer
+(@code{octave-hide-process-buffer}).
+
+@item C-c C-i k
+Kill the inferior Octave process and its buffer
+(@code{octave-kill-process}).
+
+@item C-c C-l
+Parse and execute the current file in the inferior Octave buffer
+(@code{octave-source-file}).  This is done using Octave's
+@code{source} function.
+
+@item M-.
+Find the definition of a function or variable.  Functions implemented
+in C++ can be found if variable @code{octave-source-directories} is
+set correctly (@code{octave-find-definition}).
+
+@item C-h d
+Display the documentation for function (@code{octave-help}).
+
+@item C-h a
+Search for a given string in all the first sentence of function help
+strings (@code{octave-lookfor}).  With a @code{universal-argument} the
+entire help string is searched.
+
+@end table
+
+The effect of the commands which send code to the Octave process can be
+customized by the following variables.
+
+@table @code
+@item octave-send-echo-input
+Non-@code{nil} means echo input sent to the inferior Octave process.
+Default is @code{t}.
+
+@item octave-send-show-buffer
+Non-@code{nil} means display the buffer running the Octave process after
+sending a command (but without selecting it).
+Default is @code{t}.
+@end table
+
+If you send code and there is no inferior Octave process yet, it will be
+started automatically.
+
+The startup of the inferior Octave process is highly customizable.
+The variable @code{inferior-octave-startup-args} can be used for
+specifying command lines arguments to be passed to Octave on startup
+as a list of strings.  For example, to suppress the startup message
+and use `traditional' mode, set this to @qcode{'("-q"
+"--traditional")}.  You can also specify a startup file of Octave
+commands to be loaded on startup; note that these commands will not
+produce any visible output in the process buffer.  Which file to use
+is controlled by the variable @code{inferior-octave-startup-file}.
+The default is @file{~/.emacs-octave} or if this file is not found
+@file{~/.emacs.d/init_octave.m}.
+
+By customizing @code{inferior-octave-prompt-read-only} the prompt can
+be changed to be read only.  The default value is the same as
+@code{comint-prompt-read-only}.
+
+And finally, @code{inferior-octave-mode-hook} is run after starting the
+process and putting its buffer into Inferior Octave mode.  Hence, if you
+like the up and down arrow keys to behave in the interaction buffer as
+in the shell, and you want this buffer to use nice colors, add
+@lisp
+(add-hook 'inferior-octave-mode-hook
+          (lambda ()
+            (turn-on-font-lock)
+            (define-key inferior-octave-mode-map [up]
+              'comint-previous-input)
+            (define-key inferior-octave-mode-map [down]
+              'comint-next-input)))
+@end lisp
+@noindent
+to your @file{.emacs} file.  You could also swap the roles of @kbd{C-a}
+(@code{beginning-of-line}) and @code{C-c C-a} (@code{comint-bol}) using
+this hook.
+
+@quotation
+@strong{Note} that if you set your Octave prompts to something different
+from the defaults, make sure that @code{inferior-octave-prompt} matches
+them.  Otherwise, @emph{nothing} will work, because Emacs will not know
+when Octave is waiting for input, or done sending output.
+@end quotation
+
+@node Index
+@unnumbered Index
+
+@printindex cp
+
+@bye
+
+@node Using the Emacs Info Reader for Octave
+@chapter Using the Emacs Info Reader for Octave
+
+You may also use the Emacs Info reader with Octave's @code{doc} function.
+
+If @file{gnuserv} is installed, add the lines
+@lisp
+(autoload 'octave-help "octave-hlp" nil t)
+(require 'gnuserv)
+(gnuserv-start)
+@end lisp
+@noindent
+to your @file{.emacs} file.
+
+You can use either `plain' Emacs Info or the function @code{octave-help}
+as your Octave info reader (for @samp{help -i}).  In the former case,
+use @code{info_program ("info-emacs-info")}.
+The latter is perhaps more attractive because it allows to look up keys
+in the indices of @emph{several} info files related to Octave (provided
+that the Emacs variable @code{octave-help-files} is set correctly).  In
+this case, use @code{info_program ("info-emacs-octave-help")}.
+
+If you use Octave from within Emacs, it is best to add these settings to
+your @file{~/.emacs-octave} startup file (or the file pointed to by the
+Emacs variable @code{inferior-octave-startup-file}).
-- 
1.8.5




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] Import `octave-mode' manual from GNU Octave.
  2013-12-06 22:50 ` [PATCH] Import `octave-mode' manual from GNU Octave Rüdiger Sonderfeld
@ 2013-12-07  8:31   ` Eli Zaretskii
  2013-12-07 18:21     ` [PATCH v2] " Rüdiger Sonderfeld
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2013-12-07  8:31 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: emacs-devel

> From: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
> Date: Fri, 06 Dec 2013 23:50:57 +0100
> 
> If this is acceptable I'll push it to trunk.  I'm not sure if I should
> put Kurt Hornik as the author of the change.

Thanks.  Please allow me a few comments.

> +2013-12-06  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
               ^^^^

Something's wrong here with the encoding.  (I received the mail
encoded in UTF-8, so it's not the Latin-vs-UTF messup.  The mail in
mbox format has "R=C3=83=C2=BCdiger", which looks wrong.)

> --- a/doc/misc/Makefile.in
> +++ b/doc/misc/Makefile.in
> @@ -63,14 +63,13 @@ MAKEINFO_OPTS = --force -I$(emacsdir)
>  DOCMISC_W32 = @DOCMISC_W32@
>  
>  ## Info files to build and install on all platforms.
> -INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl \
> -	dbus dired-x ebrowse ede ediff edt eieio \
> -	emacs-mime epa erc ert eshell eudc efaq \
> -	flymake forms gnus emacs-gnutls htmlfontify idlwave ido info.info \
> -	mairix-el message mh-e newsticker nxml-mode \
> -	org pcl-cvs pgg rcirc remember reftex sasl \
> -	sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \
> -	url vip viper widget wisent woman
> +INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl dbus		\
> +	dired-x ebrowse ede ediff edt eieio emacs-mime epa erc ert	\
> +	eshell eudc efaq flymake forms gnus emacs-gnutls htmlfontify	\
> +	idlwave ido info.info mairix-el message mh-e newsticker		\
> +	nxml-mode octave-mode org pcl-cvs pgg rcirc remember reftex	\
> +	sasl sc semantic ses sieve smtpmail speedbar srecode		\
> +	todo-mode tramp url vip viper widget wisent woman

Nitpicking: if possible, try not to change more than one line when all
you do is add a single manual name.

> +@c copied from GNU Octave's macros.texi.
> +@c The following macro works around the Info/plain text expansion of @code{XXX}
> +@c which is `XXX'.  This looks particularly bad when the macro body is
> +@c single or double-quoted text, such as a property value `"position"'
> +@ifinfo
> +@macro qcode{arg}
> +\arg\
> +@end macro
> +@end ifinfo
> +@ifnotinfo
> +@macro qcode{arg}
> +@code{\arg\}
> +@end macro
> +@end ifnotinfo

Yuck!  Please don't do that, it's ugly and non-standard.  AFAICS, this
macro is used for two purposes:

 . buffer name "*Inferior Octave*", for which the alternative would be
   @file{*Inferior Octave*}, as we do with "*scratch*"

 . a list of strings such as '("octave") or '("-q" "--traditional"),
   for which we use @code{("octave")} (note that the convention is to
   not place the quote ' before literal lists)

So please use our usual practices instead of this macro.

> +@node Using Octave Mode
> +@chapter Using Octave Mode

There should be a @cindex entry here.

> +@item LFD

"LFD" is a key, not a string of 3 characters, so you should give it
the @key markup.

> +Reindent the current Octave line, insert a newline and indent the new
> +line (@code{octave-reindent-then-newline-and-indent}).  An abbrev before
> +point is expanded if @code{abbrev-mode} is non-@code{nil}.
                              ^^^^^^^^^^^

It is useful to have cross-references for where the features you
mention are described, in this case abbrev-mode.  This is so the
reader could consult those places if she doesn't have a clear idea of
what abbrev-mode is.

In addition, every function and variable from Octave mode that you
mention should have a corresponding @findex or @vindex entry before
the text that mentions it.

> +Start entering an abbreviation (@code{octave-abbrev-start}).  If Abbrev
> +mode is turned on, typing @kbd{`C-h} or @kbd{`?} lists all abbrevs.

Please remove those ` from keys inside @kbd.

> +@item M-C-a
> +Move backward to the beginning of a function
> +(@code{octave-beginning-of-defun}).
> +With prefix argument @var{N}, do it that many times if @var{N} is
> +positive; otherwise, move forward to the @var{N}-th following beginning
> +of a function.

No need to capitalize N in @var.  It will be automatically capitalized
in Info output, but in other formats will get the slant typeface.

> +@item C-c C-a
> +Move to the `real' beginning of the current line

Not sure why "real" is in quotes.  If you wanted to emphasize it, use
@emph.

> +(@code{octave-beginning-of-line}).  If point is in an empty or comment
> +line, simply go to its beginning; otherwise, move backwards to the
> +beginning of the first code line which is not inside a continuation
> +statement, i.e., which does not follow a code line ending in @samp{...}
> +or @samp{\}, or is inside an open parenthesis list.

This suggests that perhaps "beginning of the physical line" is a
better term than "`real' beginning of the line".

> +considerations apply for using @key{M-RET} as @key{M-LFD}.  As Barry
> +A. Warsaw @email{bwarsaw@@cnri.reston.va.us} says in the documentation for his

@email accepts 2 arguments; I suggest to use that feature.

> +The following variables can be used to customize Octave mode.
> +
> +@table @code
> +@item octave-auto-indent

If you use @vtable instead of @table @code, all the variables you
mention will be automatically added to the variable index, as they
should be.

> +You can generate TAGS files for Emacs from Octave @file{.m} files using
> +the shell script @code{octave-tags} that is installed alongside your copy of
> +Octave.          ^^^^^^^^^^^^^^^^^^

Shell scripts are files, so should use @file markup.

> +You can also communicate with an inferior Octave process from within
> +files with Octave code (i.e., buffers in Octave mode), using the
> +following commands.
> +
> +@table @kbd
> +@item C-c C-i l

The keys here should be indexed with @kindex.

> +@node Index
> +@unnumbered Index
> +
> +@printindex cp
> +
> +@bye
> +
> +@node Using the Emacs Info Reader for Octave
> +@chapter Using the Emacs Info Reader for Octave
> +
> +You may also use the Emacs Info reader with Octave's @code{doc} function.

Anything after "@bye" will be ignored, so this last node will not be
in the output.  Is this what you meant?

Thanks again for working on this.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2] Import `octave-mode' manual from GNU Octave.
  2013-12-07  8:31   ` Eli Zaretskii
@ 2013-12-07 18:21     ` Rüdiger Sonderfeld
  2013-12-11 13:53       ` Rüdiger Sonderfeld
  0 siblings, 1 reply; 12+ messages in thread
From: Rüdiger Sonderfeld @ 2013-12-07 18:21 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

Hello Eli,
thanks for your comments.  I'm not very familiar with texinfo, yet.
So your comments were very helpful.  I hope I have fixed all the issues.

I have removed some more obsolete parts as well.  I have also updated
octave.el to reference the manual.

> Something's wrong here with the encoding.  (I received the mail
> encoded in UTF-8, so it's not the Latin-vs-UTF messup.  The mail in
> mbox format has "R=C3=83=C2=BCdiger", which looks wrong.)

I guess that's what I get for not sending the E-Mail from Emacs.  It
seems to be an issue between my mail client, imap, and git.  It seems
correct in the repo, so it should be correct when I push it.

> Anything after "@bye" will be ignored, so this last node will not be
> in the output.  Is this what you meant?

Yes.  The section is outdated.  GNU Octave calls the info(1) program
which will fail in `comint-mode'.  The section described how to work
around it by using the old `gnuserv' support and a shell script.  I
have an updated version of that shell script.  It basically emulates
info(1) by calling emacsclient with the proper flags.  But I'm not
sure how and if it should be distributed within GNU Emacs and maybe if
emacsclient one day supports elisp defined arguments it could be done
completely from emacsclient.  That's why I have commented out the
node.  I have now added literal @c's to make it more clear.

Regards,
Rüdiger

-- 8< ----------------------------------------------------------- >8 --

The manual was written by Kurt Hornik.  He agreed to assign the
copyright for it to the FSF.  I have updated and modified the manual.

* doc/misc/octave-mode.texi: Imported from GNU Octave
  (doc/interpreter/emacs.txi).
* doc/misc/Makefile.in: Add octave-mode.texi.
* lisp/progmodes/octave.el (octave-mode, inferior-octave-mode): Link
  to info manual and show keybindings and set `:group' keyword.
---
 ChangeLog                 |   6 +
 doc/misc/Makefile.in      |  14 +-
 doc/misc/octave-mode.texi | 477 ++++++++++++++++++++++++++++++++++++++++++++++
 lisp/ChangeLog            |   5 +
 lisp/progmodes/octave.el  |  18 +-
 5 files changed, 517 insertions(+), 3 deletions(-)
 create mode 100644 doc/misc/octave-mode.texi

diff --git a/ChangeLog b/ChangeLog
index 01c16d0..209eba9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-06  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
+
+	* doc/misc/octave-mode.texi: Imported from GNU Octave
+	  (doc/interpreter/emacs.txi).
+	* doc/misc/Makefile.in: Add octave-mode.texi.
+
 2013-12-01  Dmitry Gutov  <dgutov@yandex.ru>
 
 	* .dir-locals.el (log-edit-move): Add the "Author: " header.
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 70fb05e..4c72aaa 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -67,7 +67,7 @@ INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl \
 	dbus dired-x ebrowse ede ediff edt eieio \
 	emacs-mime epa erc ert eshell eudc efaq \
 	flymake forms gnus emacs-gnutls htmlfontify idlwave ido info.info \
-	mairix-el message mh-e newsticker nxml-mode \
+	mairix-el message mh-e newsticker nxml-mode octave-mode \
 	org pcl-cvs pgg rcirc remember reftex sasl \
 	sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \
 	url vip viper widget wisent woman
@@ -564,6 +564,18 @@ nxml-mode.pdf: $(nxml_mode_deps)
 nxml-mode.html: $(nxml_mode_deps)
 	$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/nxml-mode.texi
 
+octave_mode_deps = ${srcdir}/octave-mode.texi ${gfdl}
+octave-mode : $(buildinfodir)/octave-mode$(INFO_EXT)
+$(buildinfodir)/octave-mode$(INFO_EXT): $(octave_mode_deps)
+	$(mkinfodir)
+	$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/octave-mode.texi
+octave-mode.dvi: $(octave_mode_deps)
+	$(ENVADD) $(TEXI2DVI) ${srcdir}/octave-mode.texi
+octave-mode.pdf: $(octave_mode_deps)
+	$(ENVADD) $(TEXI2PDF) ${srcdir}/octave-mode.texi
+octave-mode.html: $(octave_mode_deps)
+	$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/octave-mode.texi
+
 org_deps = ${srcdir}/org.texi ${gfdl}
 org : $(buildinfodir)/org$(INFO_EXT)
 $(buildinfodir)/org$(INFO_EXT): $(org_deps)
diff --git a/doc/misc/octave-mode.texi b/doc/misc/octave-mode.texi
new file mode 100644
index 0000000..2efe9f9
--- /dev/null
+++ b/doc/misc/octave-mode.texi
@@ -0,0 +1,477 @@
+\input texinfo                  @c -*-texinfo-*-
+@c %**start of header
+@setfilename ../../info/octave-mode
+@settitle Octave Mode
+@c %**end of header
+
+@copying
+Copyright @copyright{} 1996--2013 Free Software Foundation, Inc.
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
+and with the Back-Cover Texts as in (a) below.  A copy of the license
+is included in the section entitled ``GNU Free Documentation License.''
+
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual.''
+@end quotation
+@end copying
+
+@dircategory Emacs editing modes
+@direntry
+* Octave mode: (octave-mode).         Emacs mode for editing GNU Octave files.
+@end direntry
+
+@finalout
+
+@titlepage
+@title Octave Mode
+@subtitle An Emacs mode for programming in GNU Octave
+
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@contents
+
+@ifnottex
+@node Top
+@top Octave Mode
+
+@insertcopying
+@end ifnottex
+
+@menu
+* Overview::
+* Using Octave Mode::
+* Running Octave from Within Emacs::
+* GNU Free Documentation License::
+* Key Index::
+* Variable Index::
+* Lisp Function Index::
+* Concept Index::
+@end menu
+
+@node Overview
+@chapter Overview
+
+The development of Octave code can greatly be facilitated using Emacs
+with Octave mode, a major mode for editing Octave files which can
+e.g.@: automatically indent the code, do some of the typing (with
+Abbrev mode) and show keywords, comments, strings, etc.@: in different
+faces (with Font-lock mode on devices that support it).
+
+It is also possible to run Octave from within Emacs, either by
+directly entering commands at the prompt in a buffer in Inferior
+Octave mode, or by interacting with Octave from within a file with
+Octave code.  This is useful in particular for debugging Octave code.
+
+@node Using Octave Mode
+@chapter Using Octave Mode
+@cindex Using Octave Mode
+
+In Octave mode, the following special Emacs commands can be used in
+addition to the standard Emacs commands.
+
+@table @kbd
+@item C-M-j
+@kindex C-M-j
+@findex octave-indent-new-comment-line
+@vindex octave-continuation-string
+Break Octave line at point, continuing comment if within one.  Insert
+@code{octave-continuation-string} before breaking the line unless
+inside a list.  Signal an error if within a single-quoted string.
+
+@item C-c ;
+@kindex C-c ;
+@findex octave-update-function-file-comment
+Query replace function names in function file comment.
+
+@item C-c C-p
+@kindex C-c C-p
+@findex octave-previous-code-line
+Move one line of Octave code backward, skipping empty and comment
+lines (@code{octave-previous-code-line}).  With numeric prefix
+argument @var{n}, move that many code lines backward (forward if
+@var{n} is negative).
+
+@item C-c C-n
+@kindex C-c C-n
+@findex octave-next-code-line
+Move one line of Octave code forward, skipping empty and comment lines
+(@code{octave-next-code-line}).  With numeric prefix argument @var{n},
+move that many code lines forward (backward if @var{n} is negative).
+
+@item C-c C-a
+@kindex C-c C-a
+@findex octave-beginning-of-line
+Move to the beginning of the physical line
+(@code{octave-beginning-of-line}).  If point is in an empty or comment
+line, simply go to its beginning; otherwise, move backwards to the
+beginning of the first code line which is not inside a continuation
+statement, i.e., which does not follow a code line ending in
+@samp{...}  or @samp{\}, or is inside an open parenthesis list.
+
+@item C-c C-e
+@kindex C-c C-e
+@findex octave-end-of-line
+Move to the end of the physical line (@code{octave-end-of-line}).  If
+point is in a code line, move forward to the end of the first Octave
+code line which does not end in @samp{...} or @samp{\} or is inside an
+open parenthesis list.  Otherwise, simply go to the end of the current
+line.
+
+@item C-c M-C-h
+@kindex C-c M-C-h
+@findex octave-mark-block
+Put point at the beginning of this block, mark at the end
+(@code{octave-mark-block}).  The block marked is the one that contains
+point or follows point.
+
+@item C-c ]
+@kindex C-c ]
+Close the current block on a separate line (@code{smie-close-block}).
+An error is signaled if no block to close is found.
+
+@item C-c C-f
+@kindex C-c C-f
+@findex octave-insert-defun
+Insert a function skeleton, prompting for the function's name, arguments
+and return values which have to be entered without parentheses
+(@code{octave-insert-defun}).
+@noindent
+in one of your Emacs startup files.
+@end table
+
+A common problem is that the @key{RET} key does @emph{not} indent the
+line to where the new text should go after inserting the newline.  This
+is because the standard Emacs convention is that @key{RET} (aka
+@kbd{C-m}) just adds a newline, whereas @key{LFD} (aka @kbd{C-j}) adds a
+newline and indents it.  This is particularly inconvenient for users with
+keyboards which do not have a special @key{LFD} key at all; in such
+cases, it is typically more convenient to use @key{RET} as the @key{LFD}
+key (rather than typing @kbd{C-j}).
+
+You can make @key{RET} do this by adding
+@lisp
+(define-key octave-mode-map "\C-m"
+  'octave-reindent-then-newline-and-indent)
+@end lisp
+@noindent
+to one of your Emacs startup files.  Another, more generally applicable
+solution is
+@lisp
+(defun RET-behaves-as-LFD ()
+  (let ((x (key-binding "\C-j")))
+    (local-set-key "\C-m" x)))
+(add-hook 'octave-mode-hook 'RET-behaves-as-LFD)
+@end lisp
+@noindent
+(this works for all modes by adding to the startup hooks, without
+having to know the particular binding of @key{RET} in that mode!).
+Similar considerations apply for using @key{M-RET} as @key{M-LFD}.  As
+@email{bwarsaw@@cnri.reston.va.us, Barry A. Warsaw} says in the
+documentation for his @code{cc-mode}, ``This is a very common
+question.  @code{:-)} If you want this to be the default behavior,
+don't lobby me, lobby RMS!''
+
+The following variables can be used to customize Octave mode.
+
+@vtable @code
+@item octave-blink-matching-block
+Non-@code{nil} means show matching begin of block when inserting a space,
+newline or @samp{;} after an else or end keyword.  Default is @code{t}.
+This is an extremely useful feature for automatically verifying that the
+keywords match---if they don't, an error message is displayed.
+
+@item octave-block-offset
+Extra indentation applied to statements in block structures.
+Default is 2.
+
+@item octave-continuation-offset
+Extra indentation applied to Octave continuation lines.
+Default is 4.
+
+@item octave-font-lock-texinfo-comment
+Highlight texinfo comment blocks.  The default value is @code{t}.
+@end vtable
+
+If Font Lock mode is enabled, Octave mode will display
+
+@itemize @bullet
+@item
+strings in @code{font-lock-string-face}
+
+@item
+comments in @code{font-lock-comment-face}
+
+@item
+the Octave reserved words (such as all block keywords) and the text
+functions (such as @samp{cd} or @samp{who}) which are also reserved
+using @code{font-lock-keyword-face}
+
+@item
+the built-in operators (@samp{&&}, @samp{==}, @dots{}) using
+@code{font-lock-reference-face}
+
+@item
+and the function names in function declarations in
+@code{font-lock-function-name-face}.
+
+@item
+Function comments blocks in @code{octave-function-comment-block}
+@end itemize
+
+@cindex Imenu Support
+There is also rudimentary support for Imenu (@pxref{Imenu,,, emacs,
+The GNU Emacs Manual}).  Currently, function names can be indexed.
+
+@cindex ElDoc Mode Support
+@vindex octave-eldoc-message-style
+ElDoc mode (@pxref{Lisp Doc,,, emacs, The GNU Emacs Manual}) is
+supported.  By customizing @code{octave-eldoc-message-style} it can be
+changed from displaying one or multi line hints.
+
+@c @cindex TAGS
+@c @cindex Emacs TAGS files
+@c @cindex @file{octave-tags}
+@c You can generate TAGS files for Emacs from Octave @file{.m} files using
+@c the shell script @file{octave-tags} that is installed alongside your copy of
+@c Octave.
+@c
+@vindex octave-mode-hook
+Customization of Octave mode can be performed by modification of the
+variable @code{octave-mode-hook}.
+
+@node Running Octave from Within Emacs
+@chapter Running Octave from Within Emacs
+@cindex Inferior Octave Mode
+
+Octave mode provides commands for running an inferior
+Octave process in a special Emacs buffer.  Use
+@lisp
+M-x run-octave
+@end lisp
+@noindent
+to directly start an inferior Octave process.
+
+@vindex inferior-octave-buffer
+This will start Octave in a special buffer the name of which is
+specified by the variable @code{inferior-octave-buffer} and defaults
+to @file{*Inferior Octave*}.  From within this buffer, you can
+interact with the inferior Octave process `as usual', i.e., by
+entering Octave commands at the prompt.  The buffer is in Inferior
+Octave mode, which is derived from the standard Comint mode, a major
+mode for interacting with an inferior interpreter.  See the
+documentation for @code{comint-mode} for more details, and use
+@kbd{C-h b} to find out about available special keybindings.
+
+You can also communicate with an inferior Octave process from within
+files with Octave code (i.e., buffers in Octave mode), using the
+following commands.
+
+@table @kbd
+@item C-c C-i l
+@kindex C-c C-i l
+@findex octave-send-line
+@vindex octave-send-line-auto-forward
+Send the current line to the inferior Octave process
+(@code{octave-send-line}).  With positive prefix argument @var{n},
+send that many lines.  If @code{octave-send-line-auto-forward} is
+non-@code{nil}, go to the next unsent code line.
+
+@item C-c C-i b
+@kindex C-c C-i b
+@findex octave-send-block
+Send the current block to the inferior Octave process
+(@code{octave-send-block}).
+
+@item C-c C-i f
+@kindex C-c C-i f
+@findex octave-send-defun
+Send the current function to the inferior Octave process
+(@code{octave-send-defun}).
+
+@item C-c C-i r
+@kindex C-c C-i r
+@findex octave-send-region
+Send the region to the inferior Octave process
+(@code{octave-send-region}).
+
+@item C-c C-i a
+@kindex C-c C-i a
+@findex octave-send-buffer
+Send the entire buffer to the inferior Octave process
+(@code{octave-send-buffer}).  If the buffer is associated with a file
+then sourcing the buffer by using @kbd{C-c C-l}
+(@code{octave-source-file}) should be preferred.
+
+@item C-c C-i s
+@kindex C-c C-i s
+@findex octave-show-process-buffer
+Make sure that `inferior-octave-buffer' is displayed
+(@code{octave-show-process-buffer}).
+
+@item C-c C-i q
+@kindex C-c C-i q
+@findex octave-hide-process-buffer
+Delete all windows that display the inferior Octave buffer
+(@code{octave-hide-process-buffer}).
+
+@item C-c C-i k
+@kindex C-c C-i k
+@findex octave-kill-process
+Kill the inferior Octave process and its buffer
+(@code{octave-kill-process}).
+
+@item C-c C-l
+@kindex C-c C-l
+@findex octave-source-file
+Parse and execute the current file in the inferior Octave buffer
+(@code{octave-source-file}).  This is done using Octave's
+@code{source} function.
+
+@item M-.
+@kindex M-.
+@findex octave-find-definition
+@vindex octave-source-directories
+Find the definition of a function or variable.  Functions implemented
+in C++ can be found if variable @code{octave-source-directories} is
+set correctly (@code{octave-find-definition}).
+
+@item C-h d
+@kindex C-h d
+@findex octave-help
+@vindex octave-help-buffer
+Display the documentation for function (@code{octave-help}).  The
+buffer name can be changed by customizing @code{octave-help-buffer}.
+
+@item C-h a
+@kindex C-h a
+@findex octave-lookfor
+Search for a given string in all the first sentence of function help
+strings (@code{octave-lookfor}).  With a @code{universal-argument} the
+entire help string is searched.
+
+@end table
+
+The effect of the commands which send code to the Octave process can be
+customized by the following variables.
+
+@vtable @code
+@item octave-send-echo-input
+Non-@code{nil} means echo input sent to the inferior Octave process.
+Default is @code{t}.
+
+@item octave-send-show-buffer
+Non-@code{nil} means display the buffer running the Octave process after
+sending a command (but without selecting it).
+Default is @code{t}.
+@end vtable
+
+If you send code and there is no inferior Octave process yet, it will
+be started automatically.
+
+@vindex inferior-octave-startup-args
+The startup of the inferior Octave process is highly customizable.
+The variable @code{inferior-octave-startup-args} can be used for
+specifying command lines arguments to be passed to Octave on startup
+as a list of strings.  For example, to suppress the startup message
+and use `traditional' mode, set this to @code{("-q" "--traditional")}.
+You can also specify a startup file of Octave commands to be loaded on
+startup; note that these commands will not produce any visible output
+in the process buffer.  Which file to use is controlled by the
+variable @code{inferior-octave-startup-file}.  The default is
+@file{~/.emacs-octave} or if this file is not found
+@file{~/.emacs.d/init_octave.m}.
+
+@vindex inferior-octave-prompt-read-only
+By customizing @code{inferior-octave-prompt-read-only} the prompt can
+be changed to be read only.  The default value is the same as
+@code{comint-prompt-read-only}.
+
+@vindex inferior-octave-mode-hook
+And finally, @code{inferior-octave-mode-hook} is run after starting
+the process and putting its buffer into Inferior Octave mode.  Hence,
+if you like the up and down arrow keys to behave in the interaction
+buffer as in the shell, and you want this buffer to use nice colors,
+add
+@lisp
+(add-hook 'inferior-octave-mode-hook
+          (lambda ()
+            (define-key inferior-octave-mode-map [up]
+              'comint-previous-input)
+            (define-key inferior-octave-mode-map [down]
+              'comint-next-input)))
+@end lisp
+@noindent
+to your @file{.emacs} or @file{init.el} file.  You could also swap the
+roles of @kbd{C-a} (@code{beginning-of-line}) and @code{C-c C-a}
+(@code{comint-bol}) using this hook.
+
+@vindex inferior-octave-prompt
+@quotation
+@strong{Note} that if you set your Octave prompts to something different
+from the defaults, make sure that @code{inferior-octave-prompt} matches
+them.  Otherwise, @emph{nothing} will work, because Emacs will not know
+when Octave is waiting for input, or done sending output.
+@end quotation
+
+@node GNU Free Documentation License
+@chapter GNU Free Documentation License
+@include doclicense.texi
+
+@node Key Index
+@unnumbered Key Index
+
+@printindex ky
+
+@node Variable Index
+@unnumbered Variable Index
+
+@printindex vr
+
+@node Lisp Function Index
+@unnumbered Function Index
+
+@printindex fn
+
+@node Concept Index
+@unnumbered Concept Index
+
+@printindex cp
+
+
+@bye
+
+@c TODO Update
+
+@c @node Using the Emacs Info Reader for Octave
+@c @chapter Using the Emacs Info Reader for Octave
+
+@c You may also use the Emacs Info reader with Octave's @code{doc} function.
+
+@c If @file{gnuserv} is installed, add the lines
+@c @lisp
+@c (autoload 'octave-help "octave-hlp" nil t)
+@c (require 'gnuserv)
+@c (gnuserv-start)
+@c @end lisp
+@c @noindent
+@c to your @file{.emacs} file.
+
+@c You can use either `plain' Emacs Info or the function @code{octave-help}
+@c as your Octave info reader (for @samp{help -i}).  In the former case,
+@c use @code{info_program ("info-emacs-info")}.
+@c The latter is perhaps more attractive because it allows to look up keys
+@c in the indices of @emph{several} info files related to Octave (provided
+@c that the Emacs variable @code{octave-help-files} is set correctly).  In
+@c this case, use @code{info_program ("info-emacs-octave-help")}.
+
+@c If you use Octave from within Emacs, it is best to add these settings to
+@c your @file{~/.emacs-octave} startup file (or the file pointed to by the
+@c Emacs variable @code{inferior-octave-startup-file}).
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5899f52..25f1d8c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-07  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
+
+	* progmodes/octave.el (octave-mode, inferior-octave-mode): Link to
+	info manual and show keybindings and set `:group' keyword.
+
 2013-12-06  Michael Albinus  <michael.albinus@gmx.de>
 
 	* progmodes/compile.el (compilation-start):
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 778659c..d551d0d 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -528,8 +528,14 @@ (define-derived-mode octave-mode prog-mode "Octave"
 Octave is a high-level language, primarily intended for numerical
 computations.  It provides a convenient command line interface
 for solving linear and nonlinear problems numerically.  Function
-definitions can also be stored in files and used in batch mode."
+definitions can also be stored in files and used in batch mode.
+
+See Info node `(octave-mode) Using Octave Mode' for more details.
+
+Key bindings:
+\\{octave-mode-map}"
   :abbrev-table octave-abbrev-table
+  :group 'octave
 
   (smie-setup octave-smie-grammar #'octave-smie-rules
               :forward-token  #'octave-smie-forward-token
@@ -705,8 +711,16 @@ (defun inferior-octave-process-live-p ()
   (process-live-p inferior-octave-process))
 
 (define-derived-mode inferior-octave-mode comint-mode "Inferior Octave"
-  "Major mode for interacting with an inferior Octave process."
+  "Major mode for interacting with an inferior Octave process.
+
+See Info node `(octave-mode) Running Octave from Within Emacs' for more
+details.
+
+Key bindings:
+\\{inferior-octave-mode-map}"
   :abbrev-table octave-abbrev-table
+  :group 'octave
+
   (setq comint-prompt-regexp inferior-octave-prompt)
 
   (setq-local comment-use-syntax t)
-- 
1.8.5




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] Import `octave-mode' manual from GNU Octave.
  2013-12-07 18:21     ` [PATCH v2] " Rüdiger Sonderfeld
@ 2013-12-11 13:53       ` Rüdiger Sonderfeld
  0 siblings, 0 replies; 12+ messages in thread
From: Rüdiger Sonderfeld @ 2013-12-11 13:53 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

Since there were no more comments I've committed the change.

Regards,
Rüdiger




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-12-11 13:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-21 16:36 Moving octave-mode manual from GNU Octave to GNU Emacs Rüdiger Sonderfeld
2013-11-21 17:36 ` Rüdiger Sonderfeld
2013-11-22  1:38   ` Stefan Monnier
2013-11-22  1:59     ` Rüdiger Sonderfeld
2013-11-22  2:44       ` Stefan Monnier
2013-11-21 18:53 ` Glenn Morris
2013-11-21 20:16   ` Rüdiger Sonderfeld
2013-11-22  3:01     ` Glenn Morris
2013-12-06 22:50 ` [PATCH] Import `octave-mode' manual from GNU Octave Rüdiger Sonderfeld
2013-12-07  8:31   ` Eli Zaretskii
2013-12-07 18:21     ` [PATCH v2] " Rüdiger Sonderfeld
2013-12-11 13:53       ` Rüdiger Sonderfeld

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.