LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-01-2015, 12:57 PM   #1
Don_Nadie
Member
 
Registered: Aug 2009
Posts: 49

Rep: Reputation: 0
emacs info mode: how do I make _word_ in body appear underlined?


Code:
% emacs --version
GNU Emacs 24.3.1
When reading topics in emacs info mode, I come across words that look like this: _word_. How do I make them look like this: word?
 
Old 05-01-2015, 02:13 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,815

Rep: Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100
This seems to work:

Code:
(defadvice Info-fontify-node (after fontify-underscored-words-as-underlined activate)
  (save-excursion
    (goto-char (point-min))
    (let ((inhibit-read-only t))
      (while (re-search-forward "\\_<_\\<[[:word:][:space:]]+\\>_\\_>" nil 'noerror)
        (let ((start (match-beginning 0))
              (end (match-end 0)))
          (put-text-property start (1+ start) 'invisible t)
          (put-text-property (1+ start) (1- end)
                             'font-lock-face 'underline)
          (put-text-property (1- end) end 'invisible t))))))

Last edited by ntubski; 05-04-2015 at 09:25 AM. Reason: fix regex
 
Old 05-04-2015, 04:26 AM   #3
Don_Nadie
Member
 
Registered: Aug 2009
Posts: 49

Original Poster
Rep: Reputation: 0
Sorry ntubski, your solution doesn't work for me.

I pasted your code into my .emacs file, saved that file, quit emacs, launched emacs, started emacs info, selected zsh from the info menu, and found
Code:
_simple command_
and
Code:
_precommand modifier_
and
Code:
_complex command_
in short order. They should be
Code:
simple command
precommand modifier
complex command
I also found
Code:
SHWORDSPLIT
which should actually be
Code:
SH_WORD_SPLIT
I think your code works for single words because I found
Code:
pipeline
which was
Code:
 _pipeline_
without your code.

Perhaps it's the space between words and underscores embedded in words that causes your elisp to fail.

Thank you anyway.

Last edited by Don_Nadie; 05-04-2015 at 04:32 AM. Reason: one example was incorrect
 
Old 05-04-2015, 09:27 AM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,815

Rep: Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100Reputation: 2100
Yeah, I didn't test very carefully. I've changed the regexp now, so it should work with those examples.
 
  


Reply

Tags
emacs, info


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs info missing Emacs topic peterpop Linux - Software 2 09-25-2013 08:01 AM
[SOLVED] slackbuilds and emacs info mode cmk77 Slackware 3 05-30-2011 02:05 AM
how to make 'pdflatex' work in my emacs 'auctex-mode' HoreC Linux - Software 2 12-19-2004 02:33 PM
emacs and info and rpm in text mode pleinair Mandriva 0 08-03-2004 06:43 PM
how to make an editor do as emacs's shell mode does? icoming Programming 2 05-21-2004 09:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration