emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: improvement for `delete-indentation'


From: Dave Love
Subject: Re: improvement for `delete-indentation'
Date: Thu, 08 Jan 2004 17:21:05 +0000
User-agent: Gnus/5.1005 (Gnus v5.10.5) Emacs/21.2 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> I suggest we only remove such a \ if it was followed by a \n and if it is
> not preceded by an odd number of \.

Good point.

*** simple.el~  Sat Dec 13 23:36:52 2003
--- simple.el   Thu Jan  8 13:59:50 2004
***************
*** 223,228 ****
--- 228,237 ----
                          (buffer-substring (point)
                                            (+ (point) (length fill-prefix)))))
            (delete-region (point) (+ (point) (length fill-prefix))))
+       ;; Line continuation indicated by an odd number of trailing
+       ;; escape chars.
+       (unless (zerop (% (save-excursion (skip-syntax-backward "\\")) 2))
+         (delete-backward-char))
        (fixup-whitespace))))
  
  (defalias 'join-line #'delete-indentation) ; easier to find


> PS: Luckily TeX uses / syntax rather than \ syntax for the backslash char so
> the above code won't trigger.  But then your code might want to also trigger
> in the case of / syntax (which is exactly the same from the C code's point
> of view).

Maybe.  I don't know enough about modes which might use it.

Incidentally, `fixup-whitespace' claims to deal with `white space',
but calls `delete-horizontal-space', which only deals with
spaces/tabs.




reply via email to

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