all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: sand <sand@blarg.net>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: Indentation bug in function INDENT-SEXP (from CVS sources)
Date: Sat, 03 Feb 2007 06:20:15 -0500	[thread overview]
Message-ID: <E1HDIwJ-0004tD-Rm@fencepost.gnu.org> (raw)
In-Reply-To: <74edf1b42a57241cff49d9b1b3734674@www.avvantamail.com> (message from sand on Tue, 30 Jan 2007 11:12:32 -0800)

Thanks for fixing this bug.  I will install a variant of your fix.

This is a cleaned up version, and seems to work.  Does it work well for you?

*** lisp-mode.el	21 Jan 2007 01:36:10 -0500	1.196
--- lisp-mode.el	03 Feb 2007 06:10:11 -0500	
***************
*** 1128,1146 ****
  					 (make-list (- next-depth) nil))
  		     last-depth (- last-depth next-depth)
  		     next-depth 0)))
! 	(or outer-loop-done endpos
! 	    (setq outer-loop-done (<= next-depth 0)))
! 	(if outer-loop-done
! 	    (forward-line 1)
  	  (while (> last-depth next-depth)
  	    (setq indent-stack (cdr indent-stack)
  		  last-depth (1- last-depth)))
  	  (while (< last-depth next-depth)
  	    (setq indent-stack (cons nil indent-stack)
  		  last-depth (1+ last-depth)))
! 	  ;; Now go to the next line and indent it according
  	  ;; to what we learned from parsing the previous one.
- 	  (forward-line 1)
  	  (setq bol (point))
  	  (skip-chars-forward " \t")
  	  ;; But not if the line is blank, or just a comment
--- 1128,1152 ----
  					 (make-list (- next-depth) nil))
  		     last-depth (- last-depth next-depth)
  		     next-depth 0)))
! 	(forward-line 1)
! 	;; Decide whether to exit.
! 	(if endpos
! 	    ;; If we have already reached the specified end,
! 	    ;; give up and do not reindent this line.
! 	    (if (<= endpos (point))
! 		(setq outer-loop-done t))
! 	  ;; If no specified end, we are done if we have finished one sexp.
! 	  (if (<= next-depth 0)
! 	      (setq outer-loop-done t)))
! 	(unless outer-loop-done
  	  (while (> last-depth next-depth)
  	    (setq indent-stack (cdr indent-stack)
  		  last-depth (1- last-depth)))
  	  (while (< last-depth next-depth)
  	    (setq indent-stack (cons nil indent-stack)
  		  last-depth (1+ last-depth)))
! 	  ;; Now indent the next line according
  	  ;; to what we learned from parsing the previous one.
  	  (setq bol (point))
  	  (skip-chars-forward " \t")
  	  ;; But not if the line is blank, or just a comment

  reply	other threads:[~2007-02-03 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-30 19:12 Indentation bug in function INDENT-SEXP (from CVS sources) sand
2007-02-03 11:20 ` Richard Stallman [this message]
2007-02-03 20:54   ` sand

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

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

  git send-email \
    --in-reply-to=E1HDIwJ-0004tD-Rm@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=sand@blarg.net \
    /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.
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.