unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Corneli <jcorneli@math.utexas.edu>
Subject: Re: long lines of lisp code
Date: Fri, 27 Feb 2004 12:50:23 -0600	[thread overview]
Message-ID: <E1Awn43-0006iV-00@linux183.ma.utexas.edu> (raw)
In-Reply-To: 200402271238.i1RCcN118280@dell3.ma.utexas.edu

Well the reason I was resisting using M-q is that it has to be done
intelligently to avoid messing up formatting of comments (it does
"preserve comments", so it matches the specifications I sent).  

Here is an example that clarifies what I'm actually looking
for. Here is a long comment (this is GPL code from the KM lisp
package):

;;; May 2001 - revise this: (undo <checkpoint-id>) will undo right back to <checkpoint-id> (if it exists)
;;; Returns NIL if no undo possible, <checkpoint-id> if so.
;;; If checkpoint-id = nil, then just undo to the last checkpoint.
;;; [1] When called from a program, need to do this. When called from KM> prompt, this is done automatically anyway
;;;     by (reset-inference-engine)
;;; [2] With *internal-logging*, the done flags ARE on the history trace and so undo0 will undo them. This is better
;;;     than undoing absolutely everything.


Pressing M-q in the first line results in this:

;;; May 2001 - revise this: (undo <checkpoint-id>) will undo right
;;; back to <checkpoint-id> (if it exists) Returns NIL if no undo
;;; possible, <checkpoint-id> if so.  If checkpoint-id = nil, then
;;; just undo to the last checkpoint.  [1] When called from a
;;; program, need to do this. When called from KM> prompt, this is
;;; done automatically anyway by (reset-inference-engine) [2] With
;;; *internal-logging*, the done flags ARE on the history trace and
;;; so undo0 will undo them. This is better than undoing absolutely
;;; everything.

This is the sort of formatting I was able to come up with working
"by program".

On the other hand, if I press M-q in the line following the line
that contains the [1], then in the line following the line that
contains the [2], then introducing a gap between the line that
contains `undo to the last checkpoint' and the line that contains
the [1] and pressing M-q somewhere in the first block of code,
results in this:

;;; May 2001 - revise this: (undo <checkpoint-id>) will undo right
;;; back to <checkpoint-id> (if it exists) Returns NIL if no undo
;;; possible, <checkpoint-id> if so.  If checkpoint-id = nil, then
;;; just undo to the last checkpoint.
;;; [1] When called from a program, need to do this. When called
;;;     from KM> prompt, this is done automatically anyway by
;;;     (reset-inference-engine)
;;; [2] With *internal-logging*, the done flags ARE on the history
;;;     trace and so undo0 will undo them. This is better than
;;;     undoing absolutely everything.

This looks so much better than the first attempt above, I wonder if
such beautiful formatting could ever be done automatically by a
computer *satirical grin*.

       reply	other threads:[~2004-02-27 18:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200402271238.i1RCcN118280@dell3.ma.utexas.edu>
2004-02-27 18:50 ` Joe Corneli [this message]
2004-02-27 12:01 long lines of lisp code Joe Corneli
2004-02-27 12:25 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Awn43-0006iV-00@linux183.ma.utexas.edu \
    --to=jcorneli@math.utexas.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).