unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Subject: longlines.el problems...
Date: Tue, 12 Jul 2005 01:41:39 +0200	[thread overview]
Message-ID: <85irzgewr0.fsf@lola.goethe.zz> (raw)

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]


I just tried out longlines-mode with AUCTeX/preview-latex.  Cough,
cough.  One problem that it has is that it does not preserve markers
around spaces/newlines.

Emacs' fill modes have got this right by now, in contrast.  The main
trick is that if one replaces one kind of space with another one, that
one _first_ adds the new space, then deletes the old space.  Here is
how to do this in one case (unless I am mistaken):


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 591 bytes --]

--- longlines.el	11 Jul 2005 00:37:43 +0200	1.8
+++ longlines.el	12 Jul 2005 01:32:25 +0200	
@@ -207,9 +207,10 @@
 If wrapping is performed, point remains on the line.  If the line does
 not need to be wrapped, move point to the next line and return t."
   (if (longlines-set-breakpoint)
-      (progn (backward-char 1)
-             (delete-char 1)
-             (insert-char ?\n 1)
+      (progn (insert-before-markers "\n")
+	     (backward-char 1)
+             (delete-char -1)
+	     (forward-char 1)
              nil)
     (if (longlines-merge-lines-p)
         (progn (end-of-line)

[-- Attachment #3: Type: text/plain, Size: 599 bytes --]


But it looks like quite a number of other passages might need similar
fixes.

Another thing worth mentioning is that in the presence of images, font
locking with different font sizes, proportional fonts and similar, the
wrapped column should certainly be the visual column instead of
anything else.  This means, for example, that it is completely useless
to insert a newline in the middle of an image: it only makes sense to
replace such spaces that have a different visual column.
Unfortunately, current-column does not take images into account.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

             reply	other threads:[~2005-07-11 23:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11 23:41 David Kastrup [this message]
2005-07-12 17:05 ` longlines.el problems Chong Yidong
2005-07-21 13:59 ` Line wrapping during redisplay (was: longlines.el problems...) Kim F. Storm
2005-07-21 16:59   ` Line wrapping during redisplay David Kastrup
2005-07-22 11:43     ` Chong Yidong
2005-07-22 22:52       ` Richard M. Stallman
2005-07-22  4:55   ` Line wrapping during redisplay (was: longlines.el problems...) Richard M. Stallman
2005-07-22  9:12     ` Line wrapping during redisplay Kim F. Storm
2005-07-22 22:51       ` Richard M. Stallman

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=85irzgewr0.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    /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 public inbox

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

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).