unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
@ 2009-02-20  9:12 Presto Ten
  2009-02-20 15:15 ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Presto Ten @ 2009-02-20  9:12 UTC (permalink / raw)
  To: Emacs-devel


Last year Trent W. Buck posted to emacs-devel notes about GNU Screen's 256
color mode and Emacs. To have Emacs recognize the "screen-256color" terminal
and its full range of colors, the file "term/screen-256color.el" needs to be
in the load path. Trent wrote as follows:



> So you need a file term/screen-256color.el in your load-path.  Emacs 
> 22 expects it to contain a terminal-init-screen defun.  Emacs 21 
> expects it to contain a bunch of top-level forms.  Here's what I use:: 
> 
>     ;;; This is for GNU Emacs 22 
>     (defun terminal-init-screen () 
>       "Terminal initialization function for screen." 
>       ;; Use the xterm color initialization code. 
>       (load "term/xterm") 
>       (xterm-register-default-colors) 
>       (tty-set-up-initial-frame-faces)) 
> 

(Full message at
http://www.nabble.com/Re%3A-screen%2C-256color-mode-and-ssh-p15099410.html)

Could this be added as "lisp/term/screen-256color.el" to Emacs CVS, so it
works out of the box for everyone? Having 256 colors in the terminal as
opposed to 8/16 makes a world of difference in code coloring.

(Note: GNU Screen must be compiled with --enable-color256 and have "term
screen-256color" in "$HOME/.screenrc" for 256 colors to be used.)

Presto
-- 
View this message in context: http://www.nabble.com/Add-%22lisp-term-screen-256color.el%22-for-GNU-Screen%27s-256-color-mode--tp22117277p22117277.html
Sent from the Emacs - Dev mailing list archive at Nabble.com.





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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20  9:12 Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode? Presto Ten
@ 2009-02-20 15:15 ` Stefan Monnier
  2009-02-20 17:46   ` David De La Harpe Golden
  2009-02-20 18:44   ` presto08
  0 siblings, 2 replies; 11+ messages in thread
From: Stefan Monnier @ 2009-02-20 15:15 UTC (permalink / raw)
  To: Presto Ten; +Cc: Emacs-devel

> Last year Trent W. Buck posted to emacs-devel notes about GNU Screen's 256
> color mode and Emacs. To have Emacs recognize the "screen-256color" terminal
> and its full range of colors, the file "term/screen-256color.el" needs to be
> in the load path. Trent wrote as follows:

Having a function terminal-init-screen in file screen-256color.el
doesn't make sense.  The function probably needs to be renamed to
terminal-init-screen-256color.  OTOH the file could probably be named
just term/screen.el (which would make sense if you consider that
"screen-256color" will probably turn into the standard "screen"
definition at some point in the future).

Also the `load' should probably be moved from inside to outside of the
function (tho, this is very minor).


        Stefan




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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20 15:15 ` Stefan Monnier
@ 2009-02-20 17:46   ` David De La Harpe Golden
  2009-02-20 21:09     ` Stefan Monnier
  2009-02-20 18:44   ` presto08
  1 sibling, 1 reply; 11+ messages in thread
From: David De La Harpe Golden @ 2009-02-20 17:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Presto Ten, Emacs-devel

Stefan Monnier wrote:


> Having a function terminal-init-screen in file screen-256color.el
> doesn't make sense.  The function probably needs to be renamed to
> terminal-init-screen-256color.  OTOH the file could probably be named
> just term/screen.el 

The matching algo documented in term/README  means that in the 
TERM=screen-256color case, if there's no screen-256color.el, emacs falls 
back to screen.el  ?

In that case, having the file called called screen.el and that function 
terminal-init-screen makes a lot of sense since the code Trent posted 
anyway reuses the bits of term/xterm.el which are intended to do the 
right thing for xterm vs. xterm-256color when xterm-256color falls back 
to xterm.el

=> So if that terminal-init-screen is used, calling it that and putting 
it in term/screen.el is for the best as far as I can see.










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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20 15:15 ` Stefan Monnier
  2009-02-20 17:46   ` David De La Harpe Golden
@ 2009-02-20 18:44   ` presto08
  2009-02-20 21:10     ` Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: presto08 @ 2009-02-20 18:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier kirjoitti 20.2.2009 kello 17.15:

>> Last year Trent W. Buck posted to emacs-devel notes about GNU  
>> Screen's 256
>> color mode and Emacs. To have Emacs recognize the "screen-256color"  
>> terminal
>> and its full range of colors, the file "term/screen-256color.el"  
>> needs to be
>> in the load path. Trent wrote as follows:
>
> Having a function terminal-init-screen in file screen-256color.el
> doesn't make sense.  The function probably needs to be renamed to
> terminal-init-screen-256color.  OTOH the file could probably be named
> just term/screen.el (which would make sense if you consider that
> "screen-256color" will probably turn into the standard "screen"
> definition at some point in the future).
>
> Also the `load' should probably be moved from inside to outside of the
> function (tho, this is very minor).

I suppose it makes sense to rename it to "term/screen.el", and move  
the `load' outside of the function. So, here is a new version of "term/ 
screen.el":

(load "term/xterm")

(defun terminal-init-screen ()
   "Terminal initialization function for screen."
   ;; Use the xterm color initialization code.
   (xterm-register-default-colors)
   (tty-set-up-initial-frame-faces))

I tried this on my local setup, and it seems to work with a  
"screen-256color" terminal -- all colors show up as expected with list- 
colors-display.

Would this make a good candidate for inclusion? I'm not really  
familiar enough with Emacs' terminal handling to be able to judge what  
the right thing to do is -- I would just like to see Emacs support  
screen-256color out of the box.




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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20 17:46   ` David De La Harpe Golden
@ 2009-02-20 21:09     ` Stefan Monnier
  2009-02-21 14:22       ` David De La Harpe Golden
  2009-03-06 19:38       ` presto08
  0 siblings, 2 replies; 11+ messages in thread
From: Stefan Monnier @ 2009-02-20 21:09 UTC (permalink / raw)
  To: David De La Harpe Golden; +Cc: Presto Ten, Emacs-devel

> The matching algo documented in term/README  means that in the
> TERM=screen-256color case, if there's no screen-256color.el, emacs falls
> back to screen.el  ?

Yes.

> => So if that terminal-init-screen is used, calling it that and putting it
> in term/screen.el is for the best as far as I can see.

Why don't you try it,


        Stefan




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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20 18:44   ` presto08
@ 2009-02-20 21:10     ` Stefan Monnier
  2009-02-20 21:22       ` presto08
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2009-02-20 21:10 UTC (permalink / raw)
  To: presto08; +Cc: emacs-devel

> (load "term/xterm")

> (defun terminal-init-screen ()
>   "Terminal initialization function for screen."
>   ;; Use the xterm color initialization code.
>   (xterm-register-default-colors)
>   (tty-set-up-initial-frame-faces))

> I tried this on my local setup, and it seems to work with
> a "screen-256color" terminal -- all colors show up as expected with list- 
> colors-display.

Does it work also for non-256color screen?


        Stefan




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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20 21:10     ` Stefan Monnier
@ 2009-02-20 21:22       ` presto08
  0 siblings, 0 replies; 11+ messages in thread
From: presto08 @ 2009-02-20 21:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier kirjoitti 20.2.2009 kello 23.10:

>> (load "term/xterm")
>
>> (defun terminal-init-screen ()
>>  "Terminal initialization function for screen."
>>  ;; Use the xterm color initialization code.
>>  (xterm-register-default-colors)
>>  (tty-set-up-initial-frame-faces))
>
>> I tried this on my local setup, and it seems to work with
>> a "screen-256color" terminal -- all colors show up as expected with  
>> list-
>> colors-display.
>
> Does it work also for non-256color screen?

Yes, in the sense that when TERM=screen Emacs starts up normally and  
doesn't complain about anything (and shows the normal eight colors for  
list-colors-display), if that is what you meant. Seems like reasonable  
behavior to me.




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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20 21:09     ` Stefan Monnier
@ 2009-02-21 14:22       ` David De La Harpe Golden
  2009-03-06 19:38       ` presto08
  1 sibling, 0 replies; 11+ messages in thread
From: David De La Harpe Golden @ 2009-02-21 14:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Presto Ten, Emacs-devel

Stefan Monnier wrote:
>> The matching algo documented in term/README  means that in the
>> TERM=screen-256color case, if there's no screen-256color.el, emacs falls
>> back to screen.el  ?
> 
> Yes.
> 
>> => So if that terminal-init-screen is used, calling it that and putting it
>> in term/screen.el is for the best as far as I can see.
> 
> Why don't you try it,
> 
> 

Seems to work fine  -  I do wonder if promoting the code to a  less 
terminal-specific position would be sensible (probably not right at this 
moment of course).  There's code duplication between rxvt.el and 
xterm.el to do the same thing too.














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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-02-20 21:09     ` Stefan Monnier
  2009-02-21 14:22       ` David De La Harpe Golden
@ 2009-03-06 19:38       ` presto08
  2009-03-07 19:38         ` Chong Yidong
  1 sibling, 1 reply; 11+ messages in thread
From: presto08 @ 2009-03-06 19:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: David De La Harpe Golden, emacs-devel

Stefan Monnier kirjoitti 20.2.2009 kello 23.09:

>> => So if that terminal-init-screen is used, calling it that and  
>> putting it
>> in term/screen.el is for the best as far as I can see.
>
> Why don't you try it,


Seems like this thread did not reach any conclusion. However, at least  
two people reported the suggestion working, and no open issues/ 
objections, as far as I can tell. Who should be approached about  
adding the suggested file to the Emacs CVS repository?

File "term/screen.el":

(load "term/xterm")

(defun terminal-init-screen ()
    "Terminal initialization function for screen."
    ;; Use the xterm color initialization code.
    (xterm-register-default-colors)
    (tty-set-up-initial-frame-faces))




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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
@ 2009-03-07 13:04 Xavier Maillard
  0 siblings, 0 replies; 11+ messages in thread
From: Xavier Maillard @ 2009-03-07 13:04 UTC (permalink / raw)
  To: presto08; +Cc: emacs-devel, monnier, david


   Stefan Monnier kirjoitti 20.2.2009 kello 23.09:

   >> => So if that terminal-init-screen is used, calling it that and  
   >> putting it
   >> in term/screen.el is for the best as far as I can see.
   >
   > Why don't you try it,


   Seems like this thread did not reach any conclusion. However, at least  
   two people reported the suggestion working, and no open issues/ 
   objections, as far as I can tell. Who should be approached about  
   adding the suggested file to the Emacs CVS repository?

Best bet is to report it as a wishlist entry into the emacs bug
tracking system.

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org




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

* Re: Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode?
  2009-03-06 19:38       ` presto08
@ 2009-03-07 19:38         ` Chong Yidong
  0 siblings, 0 replies; 11+ messages in thread
From: Chong Yidong @ 2009-03-07 19:38 UTC (permalink / raw)
  To: presto08; +Cc: emacs-devel, Stefan Monnier, David De La Harpe Golden

presto08@me.com writes:

> Seems like this thread did not reach any conclusion. However, at least
> two people reported the suggestion working, and no open issues/
> objections, as far as I can tell. Who should be approached about
> adding the suggested file to the Emacs CVS repository?

Please file a bug so that it's not forgotten, and we can revisit this
after the 23.1 release.




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

end of thread, other threads:[~2009-03-07 19:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-20  9:12 Add "lisp/term/screen-256color.el" for GNU Screen's 256 color mode? Presto Ten
2009-02-20 15:15 ` Stefan Monnier
2009-02-20 17:46   ` David De La Harpe Golden
2009-02-20 21:09     ` Stefan Monnier
2009-02-21 14:22       ` David De La Harpe Golden
2009-03-06 19:38       ` presto08
2009-03-07 19:38         ` Chong Yidong
2009-02-20 18:44   ` presto08
2009-02-20 21:10     ` Stefan Monnier
2009-02-20 21:22       ` presto08
  -- strict thread matches above, loose matches on Subject: below --
2009-03-07 13:04 Xavier Maillard

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