unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-devel@gnu.org
Subject: Re: change soft to hard lines and back
Date: Thu, 14 Dec 2017 16:18:04 +0100	[thread overview]
Message-ID: <87mv2libir.fsf@mat.ucm.es> (raw)
In-Reply-To: CAA1iZcfGKM04VPmESe3G9de=UwOgtER_PxLnq_7az32OLCzk4w@mail.gmail.com

>>> "Hinrik" == Hinrik Örn Sigurðsson <hinrik.sig@gmail.com> 
>>> writes: 
 
   > You can use the function set-hard-newline-properties to mark 
   > all newlines in some range as hard. For the inverse you can 
   > remove the 'hard property with (remove-text-property START 
   > END '(hard nil)). 


Thanks but that function must be very new. For GNU emacs 26 I 
obtain

Debugger entered--Lisp error: (void-function remove-text-property) 
  remove-text-property(83 84 hard t) soften-newlines() 
  funcall-interactively(soften-newlines) 
  call-interactively(soften-newlines record nil) 
  command-execute(soften-newlines record) 
  execute-extended-command(nil "soften-newlines" "soft") 
  funcall-interactively(execute-extended-command nil 
  "soften-newlines" "soft") 
  call-interactively(execute-extended-command nil nil) 
  command-execute(execute-extended-command) 
 


So I tried remove-text-properties


(defun soften-newlines () (interactive) 
  (save-excursion 
;    (goto-char (point-min)) 
    (mail-text) (while (search-forward "\n" nil t) 
      (remove-text-properties (1- (point)) (point) 'hard nil))))

But it did not work, the hardlines were not removed.




  reply	other threads:[~2017-12-14 15:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 13:44 change soft to hard lines and back Uwe Brauer
2017-12-14 14:18 ` Hinrik Örn Sigurðsson
2017-12-14 15:18   ` Uwe Brauer [this message]
2017-12-14 15:54     ` Michael Heerdegen
2017-12-14 18:04       ` Uwe Brauer
2017-12-15  2:15     ` Stefan Monnier
2017-12-15 10:19       ` Uwe Brauer
2017-12-14 23:52 ` Jorge A. Alfaro-Murillo
2017-12-15 10:20   ` Uwe Brauer

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=87mv2libir.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-devel@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).