all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* M-x compile should tell its status (a little bit better)..
@ 2004-04-21  6:15 Stephan Stahl
  2004-04-22 17:40 ` Richard Stallman
  0 siblings, 1 reply; 22+ messages in thread
From: Stephan Stahl @ 2004-04-21  6:15 UTC (permalink / raw)


Hi.

Right know when starting compile it shows "Compiling" in the mode line.
When i started several compilations in parallel i found it confusing that
i could not find out if one of them has already finished. Execpt by
switching to that buffer and looking at its mode line...
So how about to change compile to reflect that info in its mode name so
that C-x C-b could show it like it it does for dired? (dired by name/dired
by date). Maybe the same thing should be done for M-x shell, M-x term, M-x
grep and similar modes?
What do others think about this?
-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-21  6:15 M-x compile should tell its status (a little bit better) Stephan Stahl
@ 2004-04-22 17:40 ` Richard Stallman
  2004-04-22 18:54   ` Stephan Stahl
  2004-04-23 18:01   ` Kevin Rodgers
  0 siblings, 2 replies; 22+ messages in thread
From: Richard Stallman @ 2004-04-22 17:40 UTC (permalink / raw)
  Cc: emacs-devel

    Right know when starting compile it shows "Compiling" in the mode line.
    When i started several compilations in parallel i found it confusing that
    i could not find out if one of them has already finished. Execpt by
    switching to that buffer and looking at its mode line...
    So how about to change compile to reflect that info in its mode name so

Could you say more precisely what change you have in mind
in the mode line contents?

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-22 17:40 ` Richard Stallman
@ 2004-04-22 18:54   ` Stephan Stahl
  2004-04-24 14:27     ` Richard Stallman
  2004-04-23 18:01   ` Kevin Rodgers
  1 sibling, 1 reply; 22+ messages in thread
From: Stephan Stahl @ 2004-04-22 18:54 UTC (permalink / raw)
  Cc: emacs-devel

Hi.

Richard Stallman <rms@gnu.org> writes:

>     Right know when starting compile it shows "Compiling" in the mode line.
>     When i started several compilations in parallel i found it confusing that
>     i could not find out if one of them has already finished. Execpt by
>     switching to that buffer and looking at its mode line...
>     So how about to change compile to reflect that info in its mode name so
> 
> Could you say more precisely what change you have in mind
> in the mode line contents?

Yes of course. The change to the mode line would however just be a
side effect..

C-x C-b (list-buffers)
currently shows something like this:

 MR Buffer           Size  Mode         File
 -- ------           ----  ----         ----
. % ~		     2485  Dired by name ~/
. % /		     2485  Dired by date /
 *  *compilation*     142  Compilation	
 *  *compilation*<2>  142  Compilation	
 *  *compilation*<3>  476  Compilation	
 *  *compilation*<4> 1892  Compilation	


My idea is to change it like this:

 MR Buffer           Size  Mode         File
 -- ------           ----  ----         ----
. % ~		     2485  Dired by name ~/
. % /		     2485  Dired by date /
 *  *compilation*     142  Compile running	
 *  *compilation*<2>  142  Compile ok	
 *  *compilation*<3>  476  Compile ok	
 *  *compilation*<4> 1892  Compile aborted	

Just the way dired show if it sorts by name oder by date could be used
by M-x compile to show if it is still running or if it finished
with/without errors. I think things like M-x grep, M-x shell-command
would also benefit from such an aproach..

I think visual feetback is very important and this seems like just a
little change (for the better) since compile already set the
"Compiling" string in the modeline..

Stephan
-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-22 17:40 ` Richard Stallman
  2004-04-22 18:54   ` Stephan Stahl
@ 2004-04-23 18:01   ` Kevin Rodgers
  2004-04-23 21:48     ` Stephan Stahl
  2004-04-25 18:09     ` Richard Stallman
  1 sibling, 2 replies; 22+ messages in thread
From: Kevin Rodgers @ 2004-04-23 18:01 UTC (permalink / raw)


Richard Stallman wrote:

>     Right know when starting compile it shows "Compiling" in the mode line.
>     When i started several compilations in parallel i found it confusing that
>     i could not find out if one of them has already finished. Execpt by
>     switching to that buffer and looking at its mode line...
>     So how about to change compile to reflect that info in its mode name so
> 
> Could you say more precisely what change you have in mind
> in the mode line contents?

I think the idea is not to change the mode line, but to change the mode name

so that the status is apparent from `M-x list-buffers'.  I think the following
provides the desired effect, but it's just for illustration:


(defvar compilation-mode-name nil)

;; change `after' to `before', to avoid stomping on compilation-handle-exit:
(defadvice compilation-sentinel (after mode-name activate)
   "Set `mode-name' instead of `mode-line-process' to reflect the PROCess status."
   (let ((buffer (process-buffer (ad-get-arg 0)))
	(status (process-status (ad-get-arg 0))))
     (when (buffer-live-p buffer)
       (save-excursion
	(set-buffer buffer)
	;; save the original mode name:
	(unless compilation-mode-name
	  (set (make-local-variable 'compilation-mode-name) mode-name))
	;; construct a mode name from the original plus the status:
	(setq mode-name
	      (format "%s:%s)" compilation-mode-name status))
	;; remove redundant status from the mode line:
	(setq mode-line-process nil)))))

(defadvice compile-internal (after compilation-sentinel activate)
   "Call `compilation-sentinel' to set `mode-name'."
   (compilation-sentinel (get-buffer-process compilation-last-buffer)
			"started"))

-- 
Kevin Rodgers

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-23 18:01   ` Kevin Rodgers
@ 2004-04-23 21:48     ` Stephan Stahl
  2004-04-27 16:43       ` Kevin Rodgers
  2004-04-25 18:09     ` Richard Stallman
  1 sibling, 1 reply; 22+ messages in thread
From: Stephan Stahl @ 2004-04-23 21:48 UTC (permalink / raw)
  Cc: emacs-devel


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Richard Stallman wrote:
> 
> > Could you say more precisely what change you have in mind in the
> > mode line contents?
> 
> I think the idea is not to change the mode line, but to change the
> mode name so that the status is apparent from `M-x list-buffers'.  I
> think the following provides the desired effect, but it's just for
> illustration:

Yes that was my idea. I hope my example in an earlier mail was also
helpful to understand what i had in mind.

Do you think such a change would be good? And which other modes could
benefit from such a visual feedback? Maybe all modes that use an
(longrunning) inferior process..

Stephan
-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-22 18:54   ` Stephan Stahl
@ 2004-04-24 14:27     ` Richard Stallman
  0 siblings, 0 replies; 22+ messages in thread
From: Richard Stallman @ 2004-04-24 14:27 UTC (permalink / raw)
  Cc: emacs-devel

    My idea is to change it like this:

     MR Buffer           Size  Mode         File
     -- ------           ----  ----         ----
    . % ~		     2485  Dired by name ~/
    . % /		     2485  Dired by date /
     *  *compilation*     142  Compile running	
     *  *compilation*<2>  142  Compile ok	
     *  *compilation*<3>  476  Compile ok	
     *  *compilation*<4> 1892  Compile aborted	

It seems ok to me.

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-23 18:01   ` Kevin Rodgers
  2004-04-23 21:48     ` Stephan Stahl
@ 2004-04-25 18:09     ` Richard Stallman
  1 sibling, 0 replies; 22+ messages in thread
From: Richard Stallman @ 2004-04-25 18:09 UTC (permalink / raw)
  Cc: emacs-devel

    I think the idea is not to change the mode line, but to change the mode name

Setting mode-name is ok to do, since Dired does it.

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-23 21:48     ` Stephan Stahl
@ 2004-04-27 16:43       ` Kevin Rodgers
  2004-04-29 18:13         ` Stephan Stahl
  2004-07-11  1:43         ` Stephan Stahl
  0 siblings, 2 replies; 22+ messages in thread
From: Kevin Rodgers @ 2004-04-27 16:43 UTC (permalink / raw)


Stephan Stahl wrote:
 > Kevin Rodgers <ihs_4664@yahoo.com> writes:
 >>Richard Stallman wrote:
 >>>Could you say more precisely what change you have in mind in the
 >>>mode line contents?
 >>>
 >>I think the idea is not to change the mode line, but to change the
 >>mode name so that the status is apparent from `M-x list-buffers'.  I
 >>think the following provides the desired effect, but it's just for
 >>illustration:
 >
 > Yes that was my idea. I hope my example in an earlier mail was also
 > helpful to understand what i had in mind.
 >
 > Do you think such a change would be good? And which other modes could
 > benefit from such a visual feedback? Maybe all modes that use an
 > (longrunning) inferior process..

I think a better change would be to include mode-line-process in the
*Buffer List* buffer:


2004-04-27  Kevin Rodgers  <ihs_4664@yahoo.com>

	* buff-menu.el (list-buffers-noselect): Append the buffer's
	  process status to its mode name.


*** emacs-21.3/lisp/buff-menu.el.orig	Wed Aug 29 08:53:31 2001
--- emacs-21.3/lisp/buff-menu.el	Tue Apr 27 10:38:25 2004
***************
*** 503,512 ****
                 this-buffer-read-only
                 (this-buffer-size (buffer-size buffer))
                 this-buffer-mode-name
                 this-buffer-directory)
             (with-current-buffer buffer
!             (setq this-buffer-read-only buffer-read-only
!                   this-buffer-mode-name mode-name)
               (unless file
                 ;; No visited file.  Check local value of
                 ;; list-buffers-directory.
--- 503,523 ----
                 this-buffer-read-only
                 (this-buffer-size (buffer-size buffer))
                 this-buffer-mode-name
+               (this-buffer-process (get-buffer-process buffer))
                 this-buffer-directory)
             (with-current-buffer buffer
!             (setq this-buffer-read-only buffer-read-only)
!             (setq this-buffer-mode-name
!                   (concat mode-name
!                           ;; is there a way to convert an arbitrary
!                           ;; mode-line-format element to a string?
!                           (cond ((stringp mode-line-process)
!                                  mode-line-process)
!                                 (this-buffer-process ; emulate (":%s")
!                                  (concat ":"
!                                          (symbol-name
!                                           (process-status
!                                            this-buffer-process)))))))
               (unless file
                 ;; No visited file.  Check local value of
                 ;; list-buffers-directory.

-- 
Kevin Rodgers

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-27 16:43       ` Kevin Rodgers
@ 2004-04-29 18:13         ` Stephan Stahl
  2004-04-29 19:44           ` Stefan Monnier
  2004-07-11  1:43         ` Stephan Stahl
  1 sibling, 1 reply; 22+ messages in thread
From: Stephan Stahl @ 2004-04-29 18:13 UTC (permalink / raw)
  Cc: emacs-devel

Hi.

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> I think a better change would be to include mode-line-process in the
> *Buffer List* buffer:

I could not test it until now..
I think that would be a great change. Really like it.
If people think it would be good to have i could adapt the change to
the current buff-menu.el which has changed quite a bit since 21.3 over
the weekend ?

Stephan
-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-29 18:13         ` Stephan Stahl
@ 2004-04-29 19:44           ` Stefan Monnier
  0 siblings, 0 replies; 22+ messages in thread
From: Stefan Monnier @ 2004-04-29 19:44 UTC (permalink / raw)
  Cc: Kevin Rodgers, emacs-devel

>> I think a better change would be to include mode-line-process in the
>> *Buffer List* buffer:

Agreed.


        Stefan

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-04-27 16:43       ` Kevin Rodgers
  2004-04-29 18:13         ` Stephan Stahl
@ 2004-07-11  1:43         ` Stephan Stahl
       [not found]           ` <E1Bjnft-0008Qk-JH@fencepost.gnu.org>
  1 sibling, 1 reply; 22+ messages in thread
From: Stephan Stahl @ 2004-07-11  1:43 UTC (permalink / raw)
  Cc: emacs-devel

Hi Kevin.

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> I think a better change would be to include mode-line-process in the
> *Buffer List* buffer:
> 
> 
> 2004-04-27  Kevin Rodgers  <ihs_4664@yahoo.com>
> 
> 	* buff-menu.el (list-buffers-noselect): Append the buffer's
> 	  process status to its mode name.

I tried to "port" your change to cvs emacs. I really like this
addition so maybe someone wants to include it in cvs emacs.

diff -c buff-menu.el.\~1.66.\~ buff-menu.el
*** buff-menu.el.~1.66.~	Thu Apr  1 03:23:36 2004
--- buff-menu.el	Sun Jul 11 03:37:11 2004
***************
*** 613,619 ****
  			 "  "
  			 (Buffer-menu-make-sort-button "Mode" 4) mode-end
  			 (Buffer-menu-make-sort-button "File" 5) "\n"))
! 	 list desired-point name file)
      (when Buffer-menu-use-header-line
        (let ((pos 0))
  	;; Turn spaces in the header into stretch specs so they work
--- 613,619 ----
  			 "  "
  			 (Buffer-menu-make-sort-button "Mode" 4) mode-end
  			 (Buffer-menu-make-sort-button "File" 5) "\n"))
! 	 list desired-point name process mode file)
      (when Buffer-menu-use-header-line
        (let ((pos 0))
  	;; Turn spaces in the header into stretch specs so they work
***************
*** 639,645 ****
  		   (lambda (buffer)
  		     (with-current-buffer buffer
  		       (setq name (buffer-name)
! 			     file (buffer-file-name))
  		       (cond
  			;; Don't mention internal buffers.
  			((and (string= (substring name 0 1) " ") (null file)))
--- 639,657 ----
  		   (lambda (buffer)
  		     (with-current-buffer buffer
  		       (setq name (buffer-name)
! 			     process (get-buffer-process buffer)
! 			     mode (concat mode-name
! 					  ;; is there a way to convert
! 					  ;; an arbitrary mode-line-format
! 					  ;; element to a string?
! 					  (cond ((stringp mode-line-process)
! 						 mode-line-process)
! 						(process ; emulate (":%s")
! 						 (concat ":"
! 							 (symbol-name
! 							  (process-status
! 							   process))))))
! 		       file (buffer-file-name))
  		       (cond
  			;; Don't mention internal buffers.
  			((and (string= (substring name 0 1) " ") (null file)))
***************
*** 665,671 ****
  					   ?% ? )
  				       ;; Identify modified buffers.
  				       (if (buffer-modified-p) ?* ? ))
! 			       name (buffer-size) mode-name file)))))
  		   (buffer-list))))
        (dolist (buffer
  	       (if Buffer-menu-sort-column
--- 677,683 ----
  					   ?% ? )
  				       ;; Identify modified buffers.
  				       (if (buffer-modified-p) ?* ? ))
! 			       name (buffer-size) mode file)))))
  		   (buffer-list))))
        (dolist (buffer
  	       (if Buffer-menu-sort-column

-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
       [not found]             ` <61133.217.194.34.123.1089623439.squirrel@wwws.franken.de>
@ 2004-07-12 16:16               ` Stephan Stahl
  2004-07-12 17:20                 ` Stefan Monnier
  0 siblings, 1 reply; 22+ messages in thread
From: Stephan Stahl @ 2004-07-12 16:16 UTC (permalink / raw)
  Cc: emacs-devel

Hi Richard. (I've CC'ed emacs-devel again because of this possible bug..)

I said:

> Here is a new patch. With the funtion you suggested it is much simpler.
> diff -c buff-menu.el.\~1.66.\~ buff-menu.el
> *** buff-menu.el.\~1.66.\~ Mon Jul 12 11:01:15 2004
> --- buff-menu.el Mon Jul 12 11:08:58 2004
> ***************
> *** 613,619 ****
>   			 "  "
>   			 (Buffer-menu-make-sort-button "Mode" 4) mode-end
>   			 (Buffer-menu-make-sort-button "File" 5) "\n"))
> ! 	 list desired-point name file)
>       (when Buffer-menu-use-header-line
>         (let ((pos 0))
>   	;; Turn spaces in the header into stretch specs so they work
> --- 613,619 ----
>   			 "  "
>   			 (Buffer-menu-make-sort-button "Mode" 4) mode-end
>   			 (Buffer-menu-make-sort-button "File" 5) "\n"))
> ! 	 list desired-point name mode file)
>       (when Buffer-menu-use-header-line
>         (let ((pos 0))
>   	;; Turn spaces in the header into stretch specs so they work
> ***************
> *** 639,644 ****
> --- 639,647 ----
>   		   (lambda (buffer)
>   		     (with-current-buffer buffer
>   		       (setq name (buffer-name)
> + 			     mode (concat mode-name
> + 					  (if mode-line-process
> + 					      (format-mode-line mode-line-process)))
>   			     file (buffer-file-name))
>   		       (cond
>   			;; Don't mention internal buffers.
> ***************
> *** 665,671 ****
>   					   ?% ? )
>   				       ;; Identify modified buffers.
>   				       (if (buffer-modified-p) ?* ? ))
> ! 			       name (buffer-size) mode-name file)))))
>   		   (buffer-list))))
>         (dolist (buffer
>   	       (if Buffer-menu-sort-column
> --- 668,674 ----
>   					   ?% ? )
>   				       ;; Identify modified buffers.
>   				       (if (buffer-modified-p) ?* ? ))
> ! 			       name (buffer-size) mode file)))))
>   		   (buffer-list))))
>         (dolist (buffer
>   	       (if Buffer-menu-sort-column

It does however not work correctly.. I suspect format-mode-line to be guilty but have
not yet looked at the c code..

format-mode-line returns different things depending on the buffer it was called from.

With this example the bug can be seen to.

emacs -q --no-site-init
M-x shell
M-; (with-current-buffer (get-buffer "*shell*")
  (concat mode-name
	  (if mode-line-process
	      (format-mode-line mode-line-process))))
=> "Shell:run"

C-x C-b <RET>   (you should be in *scratch* now)
M-; (with-current-buffer (get-buffer "*shell*")
  (concat mode-name
	  (if mode-line-process
	      (format-mode-line mode-line-process))))
=> "Shell:no process"

Maybe someone can help me with this??

Stephan
-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-12 16:16               ` Stephan Stahl
@ 2004-07-12 17:20                 ` Stefan Monnier
  2004-07-14  0:18                   ` Richard Stallman
  0 siblings, 1 reply; 22+ messages in thread
From: Stefan Monnier @ 2004-07-12 17:20 UTC (permalink / raw)
  Cc: rms, emacs-devel

> + 			     mode (concat mode-name
> + 					  (if mode-line-process
> + 					      (format-mode-line mode-line-process)))

BTW, `mode-name' should go through format-mode-line as well.


        Stefan

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-12 17:20                 ` Stefan Monnier
@ 2004-07-14  0:18                   ` Richard Stallman
  2004-07-14  0:32                     ` David Kastrup
  2004-07-14 14:08                     ` Stefan
  0 siblings, 2 replies; 22+ messages in thread
From: Richard Stallman @ 2004-07-14  0:18 UTC (permalink / raw)
  Cc: stahl, emacs-devel

    BTW, `mode-name' should go through format-mode-line as well.

This would do no harm, but mode-name is always supposed to be a string.

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14  0:18                   ` Richard Stallman
@ 2004-07-14  0:32                     ` David Kastrup
  2004-07-14  6:55                       ` Stephan Stahl
  2004-07-14 14:08                     ` Stefan
  1 sibling, 1 reply; 22+ messages in thread
From: David Kastrup @ 2004-07-14  0:32 UTC (permalink / raw)
  Cc: stahl, Stefan Monnier, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     BTW, `mode-name' should go through format-mode-line as well.
> 
> This would do no harm, but mode-name is always supposed to be a string.

Oooh.  I am moping because in AUCTeX, I was thinking of having a few
"flags" attached to the mode-name, so that I can have a mode-name
something like

'((TeX-use-pdftex "PDF") TeX-base-mode-name (TeX-source-specials "^"))

where the actual name is automatically composed from a few `lighters'
that would look pretty foolish anywhere else.

So maybe I need to hand-construct mode-name after all.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14  0:32                     ` David Kastrup
@ 2004-07-14  6:55                       ` Stephan Stahl
  2004-07-14  8:44                         ` David Kastrup
  0 siblings, 1 reply; 22+ messages in thread
From: Stephan Stahl @ 2004-07-14  6:55 UTC (permalink / raw)
  Cc: stahl, emacs-devel, rms, Stefan Monnier

Hi David.

David Kastrup said:

> Richard Stallman <rms@gnu.org> writes:
>
>> This would do no harm, but mode-name is always supposed to be a string.
>
> Oooh.  I am moping because in AUCTeX, I was thinking of having a few
> "flags" attached to the mode-name, so that I can have a mode-name
> something like
>
> '((TeX-use-pdftex "PDF") TeX-base-mode-name (TeX-source-specials "^"))
>
> where the actual name is automatically composed from a few `lighters'
> that would look pretty foolish anywhere else.
>
> So may be I need to hand-construct mode-name after all.

I have seen that cc-mode has something similar. (c-toggle-hungry-state and
c-toggle-auto-state). It adds /h or /a or /ah to the mode name if they are
activated. It does so by adding

 (c-auto-hungry-string c-auto-hungry-string)

to minor-mode-alist. I think AUCTeX could do the same?

Well actually the docs to cc-mode are not 100% correct. It says:

   The state of the minor modes is always reflected in the minor mode
list on the modeline of the CC Mode buffer.  When auto-newline mode is
enabled, you will see `C/a' on the mode line(1).  When hungry delete
mode is enabled you will see `C/h' and if both modes were enabled, you'd
see `C/ah'.

I do however NOT see 'C/ah' in the mode line but 'C Outl o^o/ah'. cc-mode
should maybe append (c-auto-hungry-string c-auto-hungry-string) to the
front of minor-mode-alist? Then it would look like the docs say..

Stephan
-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14  6:55                       ` Stephan Stahl
@ 2004-07-14  8:44                         ` David Kastrup
  2004-07-14  9:38                           ` Stephan Stahl
  0 siblings, 1 reply; 22+ messages in thread
From: David Kastrup @ 2004-07-14  8:44 UTC (permalink / raw)
  Cc: emacs-devel, rms, Stefan Monnier

"Stephan Stahl" <stahl@eos.franken.de> writes:

> David Kastrup said:
> 
> > Richard Stallman <rms@gnu.org> writes:
> >
> >> This would do no harm, but mode-name is always supposed to be a string.
> >
> > Oooh.  I am moping because in AUCTeX, I was thinking of having a few
> > "flags" attached to the mode-name, so that I can have a mode-name
> > something like
> >
> > '((TeX-use-pdftex "PDF") TeX-base-mode-name (TeX-source-specials "^"))
> >
> > where the actual name is automatically composed from a few `lighters'
> > that would look pretty foolish anywhere else.
> >
> > So may be I need to hand-construct mode-name after all.
> 
> I have seen that cc-mode has something similar. (c-toggle-hungry-state and
> c-toggle-auto-state). It adds /h or /a or /ah to the mode name if they are
> activated. It does so by adding
> 
>  (c-auto-hungry-string c-auto-hungry-string)
> 
> to minor-mode-alist. I think AUCTeX could do the same?

The problem is that, say, RefTeX minor mode gets started within
LaTeX-mode-hook (which means at a later time) and adds its " Ref"
lighter to the front of minor-mode-alist, before the "^" lighter.
Which looks stupid.  And anyway, minor-mode-alist will not let me add
a lighter in front, and the "PDFTeX" executable naming would make
that the best choice.

> Well actually the docs to cc-mode are not 100% correct. It says:
> 
>    The state of the minor modes is always reflected in the minor mode
> list on the modeline of the CC Mode buffer.  When auto-newline mode is
> enabled, you will see `C/a' on the mode line(1).  When hungry delete
> mode is enabled you will see `C/h' and if both modes were enabled, you'd
> see `C/ah'.
> 
> I do however NOT see 'C/ah' in the mode line but 'C Outl o^o/ah'. cc-mode
> should maybe append (c-auto-hungry-string c-auto-hungry-string) to the
> front of minor-mode-alist? Then it would look like the docs say..

That's what I mean.  cc-mode _will_ probably add this to the front of
minor-mode-alist, but other modes add to the list afterwards.  One
could reshuffle the list at strategic times, but frankly, it might be
easier just to fiddle with mode-name itself.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14  8:44                         ` David Kastrup
@ 2004-07-14  9:38                           ` Stephan Stahl
  2004-07-14 13:23                             ` Kim F. Storm
  2004-07-15 13:17                             ` Richard Stallman
  0 siblings, 2 replies; 22+ messages in thread
From: Stephan Stahl @ 2004-07-14  9:38 UTC (permalink / raw)
  Cc: Stephan Stahl, emacs-devel, rms, Stefan Monnier

Hi David.

David Kastrup said:

> That's what I mean.  cc-mode _will_ probably add this to the front of
> minor-mode-alist, but other modes add to the list afterwards.  One
> could reshuffle the list at strategic times, but frankly, it might be
> easier just to fiddle with mode-name itself.

Yes you are right. CC-mode does add to the front of minor-mode-alist as do
the others.. at a later time. Thats why the order is not "right" for me.

I have a idea but i'm not sure how stupid it is :)

Currently mode-line-modes is something like this (simplified)
(...
 mode-name
 mode-line-process
 minor-mode-alist
 ...)

It could be changed to
(...
 mode-name
 helper-modes
 mode-line-process
 minor-mode-alist
 ...)

c-toggle-auto-state, c-toggle-hungry-state are really just helper modes
that are useless as single minor modes (outside the cc-mode context). I
suppose that same goes for the lighters you want to add to AUCTeX. All
those modes would than add to helper-modes and not to minor-mode-alist.

The variable helper-modes would then (more or less) be under the control
of the current major mode which will make it easy to keep it "right".

Just a idea..

Stephan
-- 
Stephan Stahl

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14  9:38                           ` Stephan Stahl
@ 2004-07-14 13:23                             ` Kim F. Storm
  2004-07-15 13:17                             ` Richard Stallman
  1 sibling, 0 replies; 22+ messages in thread
From: Kim F. Storm @ 2004-07-14 13:23 UTC (permalink / raw)
  Cc: rms, Stefan Monnier, emacs-devel

"Stephan Stahl" <stahl@eos.franken.de> writes:

> 
> I have a idea but i'm not sure how stupid it is :)

I think it is a great idea.

> 
> It could be changed to
> (...
>  mode-name
>  helper-modes
>  mode-line-process
>  minor-mode-alist
>  ...)
> 

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14  0:18                   ` Richard Stallman
  2004-07-14  0:32                     ` David Kastrup
@ 2004-07-14 14:08                     ` Stefan
  2004-07-15 13:17                       ` Richard Stallman
  1 sibling, 1 reply; 22+ messages in thread
From: Stefan @ 2004-07-14 14:08 UTC (permalink / raw)
  Cc: stahl, emacs-devel

>     BTW, `mode-name' should go through format-mode-line as well.
> This would do no harm, but mode-name is always supposed to be a string.

Why?
I haven't installed it in CVS, but in my local tree, html-mode's
`mode-name' is (sgml-xml-mode "XHTML" "HTML") so the mode name is
automatically kept in sync with the sgml-xml-mode minor mode.
It seems to work fine.


        Stefan

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14  9:38                           ` Stephan Stahl
  2004-07-14 13:23                             ` Kim F. Storm
@ 2004-07-15 13:17                             ` Richard Stallman
  1 sibling, 0 replies; 22+ messages in thread
From: Richard Stallman @ 2004-07-15 13:17 UTC (permalink / raw)
  Cc: stahl, monnier, emacs-devel

    I have a idea but i'm not sure how stupid it is :)

    Currently mode-line-modes is something like this (simplified)

The idea isn't stupid, but this is the wrong time for it.
Now we are trying to focus on fixing up what needs fixing
so we can make a release.  This doesn't need to be changed,
so let's not spend time on it now.

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

* Re: M-x compile should tell its status (a little bit better)..
  2004-07-14 14:08                     ` Stefan
@ 2004-07-15 13:17                       ` Richard Stallman
  0 siblings, 0 replies; 22+ messages in thread
From: Richard Stallman @ 2004-07-15 13:17 UTC (permalink / raw)
  Cc: stahl, emacs-devel

    > This would do no harm, but mode-name is always supposed to be a string.

    Why?

That's how it's defined and documented to be used.
Maybe after the release we could consider whether it is
a good idea to change this.  For now, let's focus
on what needs to be done to make a good release.

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

end of thread, other threads:[~2004-07-15 13:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-21  6:15 M-x compile should tell its status (a little bit better) Stephan Stahl
2004-04-22 17:40 ` Richard Stallman
2004-04-22 18:54   ` Stephan Stahl
2004-04-24 14:27     ` Richard Stallman
2004-04-23 18:01   ` Kevin Rodgers
2004-04-23 21:48     ` Stephan Stahl
2004-04-27 16:43       ` Kevin Rodgers
2004-04-29 18:13         ` Stephan Stahl
2004-04-29 19:44           ` Stefan Monnier
2004-07-11  1:43         ` Stephan Stahl
     [not found]           ` <E1Bjnft-0008Qk-JH@fencepost.gnu.org>
     [not found]             ` <61133.217.194.34.123.1089623439. squirrel@wwws.franken.de>
     [not found]             ` <61133.217.194.34.123.1089623439.squirrel@wwws.franken.de>
2004-07-12 16:16               ` Stephan Stahl
2004-07-12 17:20                 ` Stefan Monnier
2004-07-14  0:18                   ` Richard Stallman
2004-07-14  0:32                     ` David Kastrup
2004-07-14  6:55                       ` Stephan Stahl
2004-07-14  8:44                         ` David Kastrup
2004-07-14  9:38                           ` Stephan Stahl
2004-07-14 13:23                             ` Kim F. Storm
2004-07-15 13:17                             ` Richard Stallman
2004-07-14 14:08                     ` Stefan
2004-07-15 13:17                       ` Richard Stallman
2004-04-25 18:09     ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.