unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#3400: bug in add-text-properties
@ 2009-05-27  5:26 Werner LEMBERG
  2009-05-28 15:15 ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Werner LEMBERG @ 2009-05-27  5:26 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: Text/Plain, Size: 1271 bytes --]


[emacs CVS build 2009-05-13]


Steps to repeat the bug:

  0. Start `emacs -Q'.

  1. Load attached file `emacs-bug.txt' with `C-x C-f'.

  2. Load attached file `emacs-bug.el' with `load-file'.

  3. Say `M-x make-first-line-invisible'.

The first line properly disappears, however, the first character in
the now visible part of the buffer (the letter `a') makes problems: It
incorrectly refers to the character at buffer position 1 (the digit
`1').  In particular, `C-u C-x =' for letter `a' shows

---

        character: 1 (49, #o61, #x31)
preferred charset: ascii (ASCII (ISO646 IRV))
       code point: 0x31
           syntax: w 	which means: word
         category: .:Base, a:ASCII, l:Latin, r:Roman
      buffer code: #x31
        file code: #x31 (encoded by coding system undecided-unix)
          display: by this font (glyph code)
    xft:-unknown-DejaVu Sans Mono-normal-normal-normal-*-21-*-*-*-m-0-iso10646-1 (#x14)

Character code properties: customize what to show
  name: DIGIT ONE
  general-category: Nd (Number, Decimal Digit)

There are text properties here:
  intangible           t
  invisible            t

---

A side effect is that `C-a' no longer moves to the beginning of the
line.


    Werner

[-- Attachment #2: emacs-bug.txt --]
[-- Type: Text/Plain, Size: 12 bytes --]

12345
abcde

[-- Attachment #3: emacs-bug.el --]
[-- Type: Text/Plain, Size: 254 bytes --]

(defun make-first-line-invisible ()
  (interactive)
  (goto-char (point-min))
  (setq start (line-beginning-position))
  (setq end (1+ (line-end-position))) ; handle \n
  (add-text-properties start
		       end
		       '(invisible t
			 intangible t)))

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-04-22 12:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-27  5:26 bug#3400: bug in add-text-properties Werner LEMBERG
2009-05-28 15:15 ` martin rudalics
2009-05-28 16:26   ` Werner LEMBERG
2009-05-28 17:12     ` martin rudalics
2009-05-28 18:28     ` Stefan Monnier
2009-05-28 21:48       ` Werner LEMBERG
2009-05-29  2:05         ` Stefan Monnier
2009-05-29  7:00           ` Werner LEMBERG
2009-05-29 13:24             ` Lennart Borgman
2009-05-29 14:51               ` Drew Adams
2009-05-29 15:01             ` Stefan Monnier
2009-05-29 15:20               ` Werner LEMBERG
2009-05-29 16:08                 ` Stefan Monnier
2009-05-29 16:47                   ` martin rudalics
2009-05-30  5:51                     ` Werner LEMBERG
2009-05-30 10:12                       ` martin rudalics
2009-05-30  7:01                   ` Werner LEMBERG
2009-05-30 10:01                     ` Stephen Berman
2016-07-27 22:07                       ` Nicolas Petton
2016-07-29  2:26                         ` npostavs
2022-04-22 12:59                           ` bug#3400: Let C-x = show info about visible and invisible text near point Lars Ingebrigtsen

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