Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3215230
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:09:12+00:00 2026-05-17T15:09:12+00:00

I would like the whole intangible text to be deleted by delete-char and backward-delete-char

  • 0

I would like the whole intangible text to be deleted by delete-char and backward-delete-char. Any easy way?

(put-text-property (point-at-bol) (point-at-eol) 'intangible t)

kill-word and backward-kill-word will delete the intangible text, and I’d like the *-char commands to do the same.

In the user interface I am building, some critical text is invisible and intangible. So when user presses DEL (C-d) just after (before) the hidden, intangible text, the whole text should disappear.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:09:13+00:00Added an answer on May 17, 2026 at 3:09 pm

    Using an Emacs without any initialization files, and the (put-text... code you provided, I can delete characters at the beginning of the line with M-x delete-char (C-d), and delete characters at the end of the line with M-x backward-delete-char (DEL (well, that’s really delete-backward-char)).

    Edited upon clarification of question:

    These two pieces of advice will delete the entire intangible region:

    (defadvice delete-char (around delete-char-intangible activate)
      "when about to delete a char that's intangible, delete the whole region
    Only do this when #chars is 1"
      (if (and (= (ad-get-arg 0) 1)
               (get-text-property (point) 'intangible))
          (kill-region (point) (save-excursion (forward-char 1) (point)))
        ad-do-it))
    
    (defadvice delete-backward-char (around delete-backward-char-intangible activate)
      "when about to delete a char that's intangible, delete the whole region
    Only do this interactively and when #chars is 1"
      (if (and (= (ad-get-arg 0) 1) (> (point) (point-min))
               (get-text-property (- (point) 1) 'intangible))
          (kill-region (point) (save-excursion (backward-char 1) (point)))
        ad-do-it))
    

    The advice checks to ensure that the command is being called with an argument of 1, and only then will delete the entire intangible region, otherwise it behaves as normal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to copy whole directory to another directory. xcopy and My.Computer.FileSystem.CopyDirectory only
I would like to select a subset of elements from a whole that satisfy
I converted my whole site to XML/XSL and I would like to know all
We have a whole catalogue of videos which we would like to stream to
I've got a RichTextBox, and would like to highlight a whole word, given just
I would like to find a way to see what happens while my XAML
I would like to be able to hide the whole sidebar (navigation, search, toolbox)
I would like the border around the friends class to extend the whole distance
I would like to the whole of the URL including the _GET variable names
I would like to make the whole webpage, index.html for example to act as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.