* M-x compile re-uses name of old compilation buffer, contrary to documentation @ 2007-07-19 11:33 Edward Welbourne 2007-07-20 13:42 ` Richard Stallman 0 siblings, 1 reply; 27+ messages in thread From: Edward Welbourne @ 2007-07-19 11:33 UTC (permalink / raw) To: bug-gnu-emacs I opened the top-level directory of a source tree, to make it current directory. M-x compile added cvs up; to start of make command-line, hit return Killed directory buffer. Switched to *compilation* and did M-x rename-buffer Supplied name *myprog update build*, left it to finish building. After it'd finished I fixed a compile error and, with cursor in *myprog update build*, did M-x compile removed the cvs up; from the command-line, hit return. The new compilation re-used *myprog update build* as its buffer, instead of creating a new buffer called *compilation* as clearly explained in the documentation for M-x compile, specifically when explaining how to avoid conflict between compilations (albeit ones running in parallel). The problem with this is that I actually wanted to keep the ouptut from the original build - it recorded what files I've got locally changed, and contained compiler warnings that I wanted to fix ! I now have to do another cvs up to recover the list of local changes; and I'll need to make clean and make in order to recover the list of warnings. compilation-buffer-name-function is nil This is probably just a documentation bug. I can see the given behaviour might even be intended, it's just not what I'm used to, so it caught me out. In GNU Emacs 22.1.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2007-07-07 on raven, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10300000 configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.1/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.ISO-8859-15 locale-coding-system: iso-8859-15 default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-e C-p M-b M-b M-b M-b C-SPC M-f M-f M-f M-f M-w C-x o C-x o C-h C-g C-x C-x M-w C-h v C-y <return> q C-x 3 C-x k <return> M-x c o m p i l e <return> C-a M-f M-f M-f M-f M-f M-b <M-backspace> <M-backspace> <M-backspace> <M-backspace> <return> M-< C-x o q C-x k <return> C-x b * m a i <tab> <return> M-{ M-{ M-{ C-n M-> M-{ C-x C-x C-w C-b M-b a g a i n SPC C-n <return> a l s o : SPC w h a t SPC i s SPC t h e SPC b e n f <backspace> e f i t SPC f SPC <backspace> <backspace> o f SPC a d d i n g SPC a n SPC e l s e SPC t o SPC t h e s e SPC f u n c t i o n s SPC ? C-n M-> C-c C-c C-x o C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-x C-f a d j <tab> <return> M-! c v s SPC u p SPC - r SPC p e r e g r i n e <return> C-x k <return> C-x C-f <backspace> <return> M-x c o m p i l e <return> <return> C-x k <return> C-x o M-x M-p <return> <return> C-x o C-x k <return> C-x o C-x o M-x e m a <tab> b u <tab> <M-backspace> r e p <tab> <M-backspace> <M-backspace> b u <tab> g <tab> <M-backspace> r e p <tab> o <tab> r <tab> <return> Recent messages: (No changes need to be saved) Mark set [2 times] Sending...done ? quick/setup/munge P m2/src/import/EudoraImporter.cpp M quick/quick-tweaks.h M quick/windows/DocumentDesktopWindow.cpp (No files need saving) [2 times] Making completion list... [3 times] Loading emacsbug...done ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: M-x compile re-uses name of old compilation buffer, contrary to documentation 2007-07-19 11:33 M-x compile re-uses name of old compilation buffer, contrary to documentation Edward Welbourne @ 2007-07-20 13:42 ` Richard Stallman 2007-07-20 14:54 ` Edward Welbourne 0 siblings, 1 reply; 27+ messages in thread From: Richard Stallman @ 2007-07-20 13:42 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs I will clarify the doc. Thanks. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: M-x compile re-uses name of old compilation buffer, contrary to documentation 2007-07-20 13:42 ` Richard Stallman @ 2007-07-20 14:54 ` Edward Welbourne 2007-07-21 10:23 ` martin rudalics 0 siblings, 1 reply; 27+ messages in thread From: Edward Welbourne @ 2007-07-20 14:54 UTC (permalink / raw) To: rms; +Cc: bug-gnu-emacs > I will clarify the doc. OK. I'm warming to the new functionality, now that I've been using it for a few days :-) I also notice that emcas 22's HTML-mode (the one provided by sgml-mode) is treating /* and */ as comment-delimiters - at least as far as font-lock-mode is concerned - possibly in support of comments in embedded CSS style sheets, but maybe a bug in some mode-related code borrowing off C by mistake. Very tiresome in documents that talk about files, e.g. "see source/*.mk for details." And, on a wildly separate topic, I owe you some updates to the GNU make manual: see http://www.chaos.org.uk/~eddy/craft/make.html for a talk in which I tried out my changes on the Bergen LUG, to see if (a) anyone could spot any mistakes I was making and (b) whether it was intelligible. Even documentation deserves testing ... Main obstacle to supplying a patch (aside from the usual scarcity of time) is that I'm not info-literate, although I can probably remember enough TeX to work it out, Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: M-x compile re-uses name of old compilation buffer, contrary to documentation 2007-07-20 14:54 ` Edward Welbourne @ 2007-07-21 10:23 ` martin rudalics 2007-07-23 11:50 ` C-comments in sgml-mode's html-mode Edward Welbourne 0 siblings, 1 reply; 27+ messages in thread From: martin rudalics @ 2007-07-21 10:23 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs > I also notice that emcas 22's HTML-mode (the one provided by > sgml-mode) is treating /* and */ as comment-delimiters - at least as > far as font-lock-mode is concerned - possibly in support of comments > in embedded CSS style sheets, but maybe a bug in some mode-related > code borrowing off C by mistake. Very tiresome in documents that talk > about files, e.g. "see source/*.mk for details." Could you please give a recipe to reproduce this with emacs -Q? ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-21 10:23 ` martin rudalics @ 2007-07-23 11:50 ` Edward Welbourne 2007-07-23 12:02 ` Lennart Borgman (gmail) 2007-07-23 12:27 ` martin rudalics 0 siblings, 2 replies; 27+ messages in thread From: Edward Welbourne @ 2007-07-23 11:50 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs >> I also notice that emcas 22's HTML-mode (the one provided by >> sgml-mode) is treating /* and */ as comment-delimiters > Could you please give a recipe to reproduce this with emacs -Q? I'm guessing you mean -q but can't seem to reproduce it with a new session even without it. The running session from which I'm sending this e-mail still exhibits the problem, but a fresh session doesn't. Strange. But that probably means you can ignore this problem ! Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 11:50 ` C-comments in sgml-mode's html-mode Edward Welbourne @ 2007-07-23 12:02 ` Lennart Borgman (gmail) 2007-07-23 13:24 ` Edward Welbourne 2007-07-23 12:27 ` martin rudalics 1 sibling, 1 reply; 27+ messages in thread From: Lennart Borgman (gmail) @ 2007-07-23 12:02 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs Edward Welbourne wrote: >>> I also notice that emcas 22's HTML-mode (the one provided by >>> sgml-mode) is treating /* and */ as comment-delimiters >> Could you please give a recipe to reproduce this with emacs -Q? > > I'm guessing you mean -q but can't seem to reproduce it with a new > session even without it. The running session from which I'm sending > this e-mail still exhibits the problem, but a fresh session doesn't. > > Strange. > But that probably means you can ignore this problem ! Could you please use "Help - Send bug report" from the menus in that running session? This will give more information to us. PS: -Q is new in Emacs 22. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 12:02 ` Lennart Borgman (gmail) @ 2007-07-23 13:24 ` Edward Welbourne 2007-07-23 14:51 ` martin rudalics 0 siblings, 1 reply; 27+ messages in thread From: Edward Welbourne @ 2007-07-23 13:24 UTC (permalink / raw) To: bug-gnu-emacs > PS: -Q is new in Emacs 22. but absent from its info documentation ! > Could you please use "Help - Send bug report" from the menus in that > running session? hmm ... yes, I can turn menus back on ... ah, it's interactive and wants to nuke this *mail* buffer ... worked round by renaming. This appears to be just like using M-x report-emacs-bug, like I did when originally submitting this - but here it is anyway. Point was in an aflicted HTML buffer when I invoked the menu. My .emacs executes: (autoload 'html-mode "sgml-mode" "Edit HTML docs" t) (setq auto-mode-alist (cons (cons "\\.x?html?$" 'html-mode) auto-mode-alist)) (global-font-lock-mode 1) (setq font-lock-maximum-decoration t font-lock-support-mode 'lazy-lock-mode) among other things. A .html file containing <file> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"><head><title>Test page for HTML-mode /* comment issue </title><!-- */ sanity --></head><body><h1>Test page for HTML-mode /* comment issue </h1><!-- */ sanity --></body></html> </file> displays each text from /* to */ in comment-face; and each "sanity" as plain text. However, syntactic movement commands such as C-M-f correctly understand the SGML comments as comments, unconfused by the /* ... */. This only happens in my current session: I have started up a fresh session and seen the file displayed perfectly sensibly (i.e. treating /* ... */ as ordinary text). In GNU Emacs 22.1.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2007-07-07 on raven, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10300000 configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.1/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.ISO-8859-15 locale-coding-system: iso-8859-15 default-enable-multibyte-characters: t Major mode: HTML Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: . SPC SPC H o w e v e r , C-a <return> M-q <backspace> <return> C-e SPC s y n t a c t i c SPC m o v e m e n t SPC o <backspace> c o m m a n d s SPC ( C - M - M-b M-b <backspace> s u c h SPC a s SPC C-e f <return> c o r r e c t l y SPC u n d e r s t a n d SPC t h e SPC S G M L SPC c o m m e n t s SPC a s SPC c o m m e n t s C-x o C-p C-e SPC c o m <backspace> <backspace> <backspace> s a n i t y C-n C-M-b C-M-b C-b C-b C-b C-b SPC s a n i t y C-x o C-p M-f M-f C-p C-p C-p C-e SPC s a n i t y C-n M-b M-b M-b M-f C-f C-f C-f C-f C-f C-f C-f C-f SPC s a n i t y C-n C-n C-n C-p M-b M-b M-b M-b M-f ; SPC a n d SPC e a c h SPC u s e SPC o f SPC t h e SPC w o r d <M-backspace> <M-backspace> <M-backspace> <M-backspace> " s a n i t y " SPC a s SPC p l a i n SPC t e x t M-q C-n C-e C-x o C-x C-s C-x o M-{ M-{ C-f C-p M-} M-} M-{ C-SPC M-} M-} C-x C-x M-w C-x k <return> C-x <return> C-x <return> C-g C-x k <return> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> C-x o <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> <help-menu> <report-emacs-bug> Recent messages: Auto-saving...done Undo! [4 times] undo-more: No further undo information Undo! [3 times] Redo! Undo! [2 times] Redo! [2 times] Auto-saving...done Wrote /disk/home/eddy/work/tmp/comment.html Mark set Quit ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 13:24 ` Edward Welbourne @ 2007-07-23 14:51 ` martin rudalics 2007-07-23 17:49 ` Edward Welbourne 0 siblings, 1 reply; 27+ messages in thread From: martin rudalics @ 2007-07-23 14:51 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs >>PS: -Q is new in Emacs 22. > > > but absent from its info documentation ! > From the Emacs manual: `-Q' `--quick' Start emacs with minimum customizations. This is like using `-q' and `--no-site-file', but also disables the startup screen. > aflicted HTML buffer when I invoked the menu. My .emacs executes: > > (autoload 'html-mode "sgml-mode" "Edit HTML docs" t) > (setq auto-mode-alist (cons (cons "\\.x?html?$" 'html-mode) auto-mode-alist)) > (global-font-lock-mode 1) > (setq font-lock-maximum-decoration t > font-lock-support-mode 'lazy-lock-mode) > > among other things. On my system I have to require lazy-lock explicitly before doing (setq font-lock-support-mode 'lazy-lock-mode) However none of these explain the behavior you observe. Please post the results of describe-char as I asked you in my last mail. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 14:51 ` martin rudalics @ 2007-07-23 17:49 ` Edward Welbourne 0 siblings, 0 replies; 27+ messages in thread From: Edward Welbourne @ 2007-07-23 17:49 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs > >>PS: -Q is new in Emacs 22. > > > > > > but absent from its info documentation ! > > > From the Emacs manual: > `-Q' > `--quick' > Start emacs with minimum customizations. This is like using `-q' > and `--no-site-file', but also disables the startup screen. Not visible in the emacs manual I get when I C-h i d m emacs RET - but a closer look through the C-h i d list shows me that I have two of each Emacs manual, presumably because I've got Emacs 22 and Emacs 21 installed side-by-side. Each resolves to the Emacs 21.3 version. There might be some benefit to marking Emacs manuals with a version number, in the info listing ! Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 11:50 ` C-comments in sgml-mode's html-mode Edward Welbourne 2007-07-23 12:02 ` Lennart Borgman (gmail) @ 2007-07-23 12:27 ` martin rudalics 2007-07-23 16:59 ` Edward Welbourne 1 sibling, 1 reply; 27+ messages in thread From: martin rudalics @ 2007-07-23 12:27 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs >>>I also notice that emcas 22's HTML-mode (the one provided by >>>sgml-mode) is treating /* and */ as comment-delimiters >> >>Could you please give a recipe to reproduce this with emacs -Q? > > > I'm guessing you mean -q but can't seem to reproduce it with a new > session even without it. The running session from which I'm sending > this e-mail still exhibits the problem, but a fresh session doesn't. > > Strange. > But that probably means you can ignore this problem ! Could you please, in the running session, move the cursor before instances of the involved characters (in all four positions), do M-x describe-char, and post the results here. In addition, please tell us the values (with C-h v) for comment-start and comment-end in the affected buffer. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 12:27 ` martin rudalics @ 2007-07-23 16:59 ` Edward Welbourne 2007-07-23 18:41 ` martin rudalics 0 siblings, 1 reply; 27+ messages in thread From: Edward Welbourne @ 2007-07-23 16:59 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs > Could you please, in the running session, move the cursor before > instances of the involved characters (in all four positions), do M-x > describe-char, and post the results here. In addition, please tell us > the values (with C-h v) for comment-start and comment-end in the > affected buffer. comment-start is a variable defined in `newcomment.el'. Its value is "<!-- " Local in buffer comment.html; global value is nil This variable is safe as a file local variable if its value satisfies the predicate `string-or-null-p'. Documentation: *String to insert to start a new comment, or nil if no comment syntax. comment-end is a variable defined in `newcomment.el'. Its value is " -->" Local in buffer comment.html; global value is "" This variable is safe as a file local variable if its value satisfies the predicate `string-or-null-p'. Documentation: *String to insert to end a new comment. Should be an empty string if comments are terminated by end-of-line. Not sure what you mean by "in all four positions", but here are the results for each of the four characters in " /* " in the title: character: SPC (32, #o40, #x20, U+0020) charset: ascii (ASCII (ISO646 IRV)) code point: #x20 syntax: which means: whitespace category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x20 file code: #x20 (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x20) There are text properties here: face (bold underline) fontified t character: / (47, #o57, #x2f, U+002F) charset: ascii (ASCII (ISO646 IRV)) code point: #x2F syntax: . 14 which means: punctuation, is the first character of a comment-start sequence, is the second character of a comment-end sequence category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x2F file code: #x2F (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x2F) There are text properties here: face (bold underline font-lock-comment-face) fontified t character: * (42, #o52, #x2a, U+002A) charset: ascii (ASCII (ISO646 IRV)) code point: #x2A syntax: . 23 which means: punctuation, is the second character of a comment-start sequence, is the first character of a comment-end sequence category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x2A file code: #x2A (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x2A) There are text properties here: face (bold underline font-lock-comment-face) fontified t character: SPC (32, #o40, #x20, U+0020) charset: ascii (ASCII (ISO646 IRV)) code point: #x20 syntax: which means: whitespace category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x20 file code: #x20 (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x20) There are text properties here: face (bold underline font-lock-comment-face) fontified t Similarly, for " */ " in the comment after the title: character: SPC (32, #o40, #x20, U+0020) charset: ascii (ASCII (ISO646 IRV)) code point: #x20 syntax: which means: whitespace category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x20 file code: #x20 (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x20) There are text properties here: face font-lock-comment-face fontified t character: * (42, #o52, #x2a, U+002A) charset: ascii (ASCII (ISO646 IRV)) code point: #x2A syntax: . 23 which means: punctuation, is the second character of a comment-start sequence, is the first character of a comment-end sequence category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x2A file code: #x2A (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x2A) There are text properties here: face font-lock-comment-face fontified t character: / (47, #o57, #x2f, U+002F) charset: ascii (ASCII (ISO646 IRV)) code point: #x2F syntax: . 14 which means: punctuation, is the first character of a comment-start sequence, is the second character of a comment-end sequence category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x2F file code: #x2F (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x2F) There are text properties here: face font-lock-comment-face fontified t character: SPC (32, #o40, #x20, U+0020) charset: ascii (ASCII (ISO646 IRV)) code point: #x20 syntax: which means: whitespace category: a:ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0]) l:Latin buffer code: #x20 file code: #x20 (encoded by coding system undecided-unix) display: by this font (glyph code) -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1 (#x20) There are text properties here: fontified t Is that what you wanted ? Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 16:59 ` Edward Welbourne @ 2007-07-23 18:41 ` martin rudalics 2007-07-24 8:57 ` Edward Welbourne 0 siblings, 1 reply; 27+ messages in thread From: martin rudalics @ 2007-07-23 18:41 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs > character: / (47, #o57, #x2f, U+002F) > charset: ascii (ASCII (ISO646 IRV)) > code point: #x2F > syntax: . 14 which means: punctuation, > is the first character of a comment-start sequence, > is the second character of a comment-end sequence Some css-mode I presume. > There are text properties here: > face (bold underline font-lock-comment-face) > fontified t Looks like a weird mixture of html- and css-mode. Are you using a css-mode or html-helper-mode? > Is that what you wanted ? Yes, thank you very much. BTW, I recommend you remove the (global-font-lock-mode 1) (setq font-lock-maximum-decoration t font-lock-support-mode 'lazy-lock-mode) lines from your .emacs. jit-lock-mode supersedes lazy-lock-mode for some time already and the other settings are default. These settings are, however, not responsible for the behavior you describe. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-23 18:41 ` martin rudalics @ 2007-07-24 8:57 ` Edward Welbourne 2007-07-24 13:01 ` martin rudalics 0 siblings, 1 reply; 27+ messages in thread From: Edward Welbourne @ 2007-07-24 8:57 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs > Some css-mode I presume. That was my guess, too (see initial report). >> There are text properties here: >> face (bold underline font-lock-comment-face) >> fontified t > Looks like a weird mixture of html- and css-mode. Are you using > a css-mode or html-helper-mode? However, C-h m gives me a buffer full of mode information in which searching for css gets no hits, as does searching for helper. It starts with <quote> Enabled minor modes: Auto-Compression Blink-Cursor File-Name-Shadow Font-Lock Global-Font-Lock Line-Number Mouse-Wheel Tooltip Unify-8859-On-Encoding Utf-Translate-Cjk </quote> (and I've no idea what's putting in File-Name-Shadow, Tooltip or the two encoding-related ones on the last line), introducing the major mode as: <quote> HTML mode: Major mode based on SGML mode for editing HTML documents. </quote> Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 8:57 ` Edward Welbourne @ 2007-07-24 13:01 ` martin rudalics 2007-07-24 13:51 ` Edward Welbourne 2007-07-24 14:39 ` Edward Welbourne 0 siblings, 2 replies; 27+ messages in thread From: martin rudalics @ 2007-07-24 13:01 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs >>Some css-mode I presume. > > > That was my guess, too (see initial report). I was aware of your guess. By looking at the text properties I wanted to exclude your guess about C. > However, C-h m gives me a buffer full of mode information in which > searching for css gets no hits, as does searching for helper. C-h m won't tell about any remnants left by a mode in a buffer after the mode has been turned off. In your case someone has set up the syntax of / and * much as a css-mode would do. What does C-h f css-mode say on your system? ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 13:01 ` martin rudalics @ 2007-07-24 13:51 ` Edward Welbourne 2007-07-24 14:51 ` Lennart Borgman (gmail) 2007-07-24 16:44 ` martin rudalics 2007-07-24 14:39 ` Edward Welbourne 1 sibling, 2 replies; 27+ messages in thread From: Edward Welbourne @ 2007-07-24 13:51 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs > > However, C-h m gives me a buffer full of mode information in which > > searching for css gets no hits, as does searching for helper. > C-h m won't tell about any remnants left by a mode in a buffer after the > mode has been turned off. However, everything I've reported has been based on freshly-opened buffers looking at the simple test file from my Help -> Report a bug menu report. Although there seems to be something odd in my *session* the problem isn't due to anything odd in any particular *buffer*, or its history. Presumably a data structure associated with html-mode has been mangled. > In your case someone has set up the syntax of / and * much as a > css-mode would do. What does C-h f css-mode say on your system? <quote src="C-h f css-mode RET"> css-mode is an interactive compiled Lisp function in `css-mode.el'. (css-mode) Major mode for editing CSS style sheets. key binding --- ------- C-c Prefix Command ESC Prefix Command " cssm-insert-quotes ( cssm-insert-parenthesises [ cssm-insert-brackets { cssm-insert-curlies } cssm-insert-right-brace-and-indent M-TAB cssm-complete-property C-c C-c cssm-insert-comment C-c C-u cssm-insert-url </quote> and I don't believe I've used it directly ('though I may have looked at a .css file at some point, which would cause it to load automagically). However, when I open up comment.html in a fresh clean emacs -Q, it doesn't believe in css-mode at all. I just get a bell (and [No match] in minibuffer) when I try C-h f css-mode RET. No script in my usual .emacs (a minimal .emacs which adds an entry to load-path and loads a bunch of little fragments from a directory of mine) mentions css-mode. In an emacs -q session, it knows it would autoload css-mode if asked for: loading a css file, I now find I am able to reproduce the bug in a new session :-) So, steps to reproduce: in an emacs -q session evaluate <quote> (autoload 'html-mode "sgml-mode" "Edit HTML docs" t) (setq auto-mode-alist (cons (cons "\\.x?html?$" 'html-mode) auto-mode-alist)) </quote>, visit a .css file (it need not exist / can be empty), open a .html file containing: <quote> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"><head><title>Test page for HTML-mode /* comment issue </title><!-- */ sanity --></head><body><h1>Test page for HTML-mode /* comment issue </h1><!-- */ sanity --></body></html> </quote> It would appear that css-mode is hacking html-mode ! Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 13:51 ` Edward Welbourne @ 2007-07-24 14:51 ` Lennart Borgman (gmail) 2007-07-24 15:46 ` Edward Welbourne 2007-07-24 16:44 ` martin rudalics 1 sibling, 1 reply; 27+ messages in thread From: Lennart Borgman (gmail) @ 2007-07-24 14:51 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs Edward Welbourne wrote: >> In your case someone has set up the syntax of / and * much as a >> css-mode would do. What does C-h f css-mode say on your system? > > <quote src="C-h f css-mode RET"> > > css-mode is an interactive compiled Lisp function in `css-mode.el'. > (css-mode) > > Major mode for editing CSS style sheets. > key binding > --- ------- > > C-c Prefix Command > ESC Prefix Command > " cssm-insert-quotes > ( cssm-insert-parenthesises > [ cssm-insert-brackets > { cssm-insert-curlies > } cssm-insert-right-brace-and-indent > > M-TAB cssm-complete-property > > C-c C-c cssm-insert-comment > C-c C-u cssm-insert-url > > </quote> If you put point in the help buffer at `css-mode.el' and press RET it will open the file css-mode.el. Could you please look at the beginning of that file and show us what it says (version, author etc)? If you in this file do C-h v buffer-file-name RET you can see where that file is located. > and I don't believe I've used it directly ('though I may have > looked at a .css file at some point, which would cause it to load > automagically). However, when I open up comment.html in a fresh clean > emacs -Q, it doesn't believe in css-mode at all. I just get a bell > (and [No match] in minibuffer) when I try C-h f css-mode RET. No > script in my usual .emacs (a minimal .emacs which adds an entry to > load-path and loads a bunch of little fragments from a directory of > mine) mentions css-mode. > > In an emacs -q session, it knows it would autoload css-mode if asked > for: loading a css file, I now find I am able to reproduce the bug in > a new session :-) > > So, steps to reproduce: in an emacs -q session evaluate <quote> > (autoload 'html-mode "sgml-mode" "Edit HTML docs" t) > (setq auto-mode-alist (cons (cons "\\.x?html?$" 'html-mode) auto-mode-alist)) > </quote>, visit a .css file (it need not exist / can be empty), > open a .html file containing: <quote> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> > <html lang="en"><head><title>Test page for HTML-mode /* comment issue </title><!-- */ sanity > --></head><body><h1>Test page for HTML-mode /* comment issue </h1><!-- */ sanity --></body></html> > </quote> > > It would appear that css-mode is hacking html-mode ! This does not happen for me when starting with emacs -q. Nor does it happen for you with -Q. Using -q site-start.el is run, but it is not run when using -Q. Can you please do M-x find-library RET site-start RET and show us the file? ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 14:51 ` Lennart Borgman (gmail) @ 2007-07-24 15:46 ` Edward Welbourne 2007-07-24 16:47 ` martin rudalics 0 siblings, 1 reply; 27+ messages in thread From: Edward Welbourne @ 2007-07-24 15:46 UTC (permalink / raw) To: Lennart Borgman (gmail); +Cc: bug-gnu-emacs > If you put point in the help buffer at `css-mode.el' and press RET it > will open the file css-mode.el. Could you please look at the beginning > of that file and show us what it says (version, author etc)? (defvar cssm-version "0.11.zap1" "The current version number of css-mode.") ;;; copyright (c) 1998 Lars Marius Garshol, larsga@ifi.uio.no ;;; $Id: css-mode.el,v 1.9 2000/01/05 21:21:56 larsga Exp $ ;;; Modified by John Zaitseff, 3rd November 2004. and I can confirm <quote src="C-h v cssm-version RET"> cssm-version is a variable defined in `css-mode.el'. Its value is "0.11.zap1" Documentation: The current version number of css-mode. </quote> and this coincides with what I find early in /usr/share/emacs22/site-lisp/css-mode/css-mode.elc shortly after ;;; Compiled by root@opera.com on Wed Jul 18 10:39:53 2007 ;;; from file /usr/share/emacs22/site-lisp/css-mode/css-mode.el ;;; in Emacs version 22.1.1 ;;; with all optimizations. which is odd, because the .el file it mentions doesn't exist. In load-path, "/usr/share/emacs22/site-lisp/css-mode" appears before "/usr/share/emacs/site-lisp/css-mode". > If you in this file do > C-h v buffer-file-name RET > you can see where that file is located. buffer-file-name is a variable defined in `C source code'. Its value is "/usr/share/emacs/site-lisp/css-mode/css-mode.el" Local in buffer css-mode.el; global value is nil Automatically becomes buffer-local when set in any fashion. Documentation: Name of file visited in current buffer, or nil if not visiting a file. > This does not happen for me when starting with emacs -q. Nor does it > happen for you with -Q. confirmed, also for .mk; and also using --no-site-file instead of -q or -Q (so my .emacs is innocent :-) > Can you please do > M-x find-library RET site-start RET > and show us the file? <quote src="/etc/emacs/site-start.el"> ;; Emacsen independent startup file. All of the various installed ;; flavors of emacs (emacs 19, emacs 20, xemacs) will load this file ;; at startup. Make sure any code you put here is emacs flavor ;; independent. ;; Package maintainers: do not have Debian packages edit this file. ;; See the policy manual for the proper way to handle Emacs package ;; initialization code. </quote> containing *no* code. The policy document referenced is /usr/share/doc/emacsen-common/debian-emacs-policy.gz and makes clear that this file is "the sole domain of the local system admin" which would fit with it being empty. I configure ~/.emacs rather than the site ... Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 15:46 ` Edward Welbourne @ 2007-07-24 16:47 ` martin rudalics 2007-07-24 20:05 ` Edward Welbourne ` (2 more replies) 0 siblings, 3 replies; 27+ messages in thread From: martin rudalics @ 2007-07-24 16:47 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs > (defvar cssm-version "0.11.zap1" > "The current version number of css-mode.") > ;;; copyright (c) 1998 Lars Marius Garshol, larsga@ifi.uio.no > ;;; $Id: css-mode.el,v 1.9 2000/01/05 21:21:56 larsga Exp $ > ;;; Modified by John Zaitseff, 3rd November 2004. css-mode by Garshol, modified by Zaitseff, and distributed by Debian. Apparently, Zaitseff's modifications are too persistent but I can't tell anything because I don't have the sources. In any case this should be reported to the Debian bug tracking system since probably more people might be affected by this. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 16:47 ` martin rudalics @ 2007-07-24 20:05 ` Edward Welbourne 2007-07-25 7:59 ` martin rudalics 2007-07-24 20:42 ` Edward Welbourne 2007-07-24 21:53 ` Lennart Borgman (gmail) 2 siblings, 1 reply; 27+ messages in thread From: Edward Welbourne @ 2007-07-24 20:05 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs > In any case this should be reported to the Debian bug tracking > system since probably more people might be affected by this. Debian bug submitted. I'll follow up with bug number and URL once the robots answer. > Apparently, Zaitseff's modifications are too persistent but I can't tell > anything because I don't have the sources. Source follows, Eddy. -- ;;;; A major mode for editing CSS. ;;; Adds font locking, some rather primitive indentation handling and ;;; some typing help. ;;; (defvar cssm-version "0.11.zap1" "The current version number of css-mode.") ;;; copyright (c) 1998 Lars Marius Garshol, larsga@ifi.uio.no ;;; $Id: css-mode.el,v 1.9 2000/01/05 21:21:56 larsga Exp $ ;;; Modified by John Zaitseff, 3rd November 2004. ;;; css-mode is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published ;;; by the Free Software Foundation; either version 2, or (at your ;;; option) any later version. ;;; ;;; css-mode is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Emacs; see the file COPYING. If not, write to the ;;; Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ; Send me an email if you want new features (or if you add them yourself). ; I will do my best to preserve the API to functions not explicitly marked ; as internal and variables shown as customizable. I make no promises about ; the rest. ; Bug reports are very welcome. New versions of the package will appear at ; http://www.stud.ifi.uio.no/~larsga/download/css-mode.html ; You can register at the same address if you want to be notified when a ; new version appears. ; Thanks to Philippe Le Hegaret, Kjetil Kjernsmo, Alf-Ivar Holm and ; Alfred Correira for much useful feedback. Alf-Ivar Holm also contributed ; patches. ; To install, put this in your .emacs: ; ; (autoload 'css-mode "css-mode") ; (setq auto-mode-alist ; (cons '("\\.css\\'" . css-mode) auto-mode-alist)) ;; Todo: ; - must not color URL file name extensions as class selectors (*.css) ; - color [] and url() constructs correctly, even if quoted strings present ; - disregard anything inside strings ;; Possible later additions: ; ; - forward/backward style/@media rule commands ; - more complete syntax table ;; Required modules (require 'apropos) (require 'font-lock) (require 'cl) ;;; The code itself ; Customizable variables: (defvar cssm-indent-level 2 "The indentation level inside rules.") (defvar cssm-mirror-mode t "Whether brackets, quotes etc should be mirrored automatically on insertion.") (defvar cssm-newline-before-closing-bracket nil "In mirror-mode, controls whether a newline should be inserted before the closing bracket or not.") (defvar cssm-indent-function #'cssm-old-style-indenter "Which function to use when deciding which column to indent to. To get C-style indentation, use cssm-c-style-indenter. To get old-style indentation, use cssm-old-style-indenter.") ; The rest of the code: (defvar cssm-properties '("font-family" "font-style" "font-variant" "font-weight" "font-size" "font" "background-color" "background-image" "background-repeat" "background-attachment" "background-position" "background" "color" "word-spacing" "letter-spacing" "text-decoration" "vertical-align" "text-transform" "text-align" "text-indent" "line-height" "margin-top" "margin-right" "margin-bottom" "margin-left" "margin" "padding-top" "padding-right" "padding-bottom" "padding-left" "padding" "border-top-width" "border-right-width" "border-left-width" "border-bottom-width" "border-width" "border-color" "border-style" "border-top" "border-right" "border-bottom" "border-left" "border" "width" "height" "float" "clear" "display" "white-space" "list-style-type" "list-style-image" "list-style-position" "list-style" ; CSS level 2.1: "border-bottom-color" "border-bottom-style" "border-collapse" "border-left-color" "border-left-style" "border-right-color" "border-right-style" "border-spacing" "border-top-color" "border-top-style" "bottom" "caption-side" "clip" "content" "counter-increment" "counter-reset" "cursor" "direction" "empty-cells" "left" "max-height" "max-width" "min-height" "min-width" "orphans" "outline" "outline-color" "outline-style" "outline-width" "overflow" "page-break-after" "page-break-before" "page-break-inside" "position" "quotes" "right" "table-layout" "top" "unicode-bidi" "visibility" "widows" "z-index" ; CSS level 2 (dropped from 2.1): "azimuth" "cue" "cue-after" "cue-before" "elevation" "font-size-adjust" "font-stretch" "marker-offset" "marks" "page" "pause" "pause-after" "pause-before" "pitch" "pitch-range" "play-during" "richness" "size" "speak" "speak-header" "speak-numeral" "speak-punctuation" "speech-rate" "stress" "text-shadow" "voice-family" "volume" ; Non-standard properties "cell-spacing" "column-span" "row-span" "speak-date" "speak-time") "A list of all CSS properties.") (defvar cssm-properties-alist (mapcar (lambda(prop) (cons (concat prop ":") nil)) cssm-properties) "An association list of the CSS properties for completion use.") (defvar cssm-keywords (append '("!\\s-*important" ; CSS level 2: "@media" "@import" "@page" "@font-face") (mapcar (lambda(property) (concat property "\\s-*:")) cssm-properties)) "A list of all CSS keywords.") (defvar cssm-pseudos '("link" "visited" "active" "first-line" "first-letter" ; CSS level 2 "first-child" "before" "after" "hover" "focus" "lang") "A list of all CSS pseudo-classes.") ; internal (defun cssm-list-2-regexp(altlist) "Takes a list and returns the regexp \\(elem1\\|elem2\\|...\\)" (let ((regexp "\\(")) (mapcar (lambda(elem) (setq regexp (concat regexp elem "\\|"))) altlist) (concat (substring regexp 0 -2) ; cutting the last "\\|" "\\)") )) (defvar cssm-font-lock-keywords (list (cons (cssm-list-2-regexp cssm-keywords) font-lock-keyword-face) (cons "\\.[a-zA-Z][-a-zA-Z0-9.]+" font-lock-variable-name-face) (cons (concat ":" (cssm-list-2-regexp cssm-pseudos)) font-lock-variable-name-face) (cons "#[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)?" font-lock-reference-face) (cons "\\[.*\\]" font-lock-variable-name-face) (cons "#[-a-zA-Z0-9]*" font-lock-function-name-face) (cons "rgb(\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*,\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*,\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*)" font-lock-reference-face) ) "Rules for highlighting CSS style sheets.") (defvar cssm-mode-map () "Keymap used in CSS mode.") (when (not cssm-mode-map) (setq cssm-mode-map (make-sparse-keymap)) (define-key cssm-mode-map (read-kbd-macro "C-c C-c") 'cssm-insert-comment) (define-key cssm-mode-map (read-kbd-macro "C-c C-u") 'cssm-insert-url) (define-key cssm-mode-map (read-kbd-macro "}") 'cssm-insert-right-brace-and-indent) (define-key cssm-mode-map (read-kbd-macro "M-TAB") 'cssm-complete-property)) ;;; Cross-version compatibility layer (when (not (or (apropos-macrop 'kbd) (fboundp 'kbd))) (defmacro kbd (keys) "Convert KEYS to the internal Emacs key representation. KEYS should be a string constant in the format used for saving keyboard macros (see `insert-kbd-macro')." (read-kbd-macro keys))) ;;; Auto-indentation support ; internal (defun cssm-insert-right-brace-and-indent() (interactive) (insert "}") (cssm-indent-line)) ; internal (defun cssm-inside-atmedia-rule() "Decides if point is currently inside an @media rule." (let ((orig-pos (point)) (atmedia (re-search-backward "@media" 0 t)) (balance 1) ; used to keep the {} balance, 1 because we start on a { ) ; Going to the accompanying { (re-search-forward "{" (point-max) t) (if (null atmedia) nil ; no @media before this point => not inside (while (and (< (point) orig-pos) (< 0 balance)) (if (null (re-search-forward "[{}]" (point-max) 0)) (goto-char (point-max)) ; break (setq balance (if (string= (match-string 0) "{") (+ balance 1) (- balance 1))))) (= balance 1)) )) ; internal (defun cssm-rule-is-atmedia() "Decides if point is currently on the { of an @media or ordinary style rule." (let ((result (re-search-backward "[@}{]" 0 t))) (if (null result) nil (string= (match-string 0) "@")))) ; internal (defun cssm-find-column(first-char) "Find which column to indent to." ; Find out where to indent to by looking at previous lines ; spinning backwards over comments (let (pos) (while (and (setq pos (re-search-backward (cssm-list-2-regexp '("/\\*" "\\*/" "{" "}")) (point-min) t)) (string= (match-string 0) "*/")) (search-backward "/*" (point-min) t)) ; did the last search find anything? (if pos (save-excursion (let ((construct (match-string 0)) (column (current-column))) (apply cssm-indent-function (list (cond ((string= construct "{") (cond ((cssm-rule-is-atmedia) 'inside-atmedia) ((cssm-inside-atmedia-rule) 'inside-rule-and-atmedia) (t 'inside-rule))) ((string= construct "/*") 'inside-comment) ((string= construct "}") (if (cssm-inside-atmedia-rule) 'inside-atmedia 'outside)) (t 'outside)) column first-char)))) (apply cssm-indent-function (list 'outside (current-column) first-char))))) (defun cssm-indent-line() "Indents the current line." (interactive) (beginning-of-line) (let* ((beg-of-line (point)) (pos (re-search-forward "[]@#a-zA-Z0-9;,.\"{}/*\n:[]" (point-max) t)) (first (match-string 0)) (start (match-beginning 0))) (goto-char beg-of-line) (let ((indent-column (cssm-find-column first))) (goto-char beg-of-line) ; Remove all leading whitespace on this line ( (if (not (or (null pos) (= beg-of-line start))) (kill-region beg-of-line start)) (goto-char beg-of-line) ; Indent (while (< 0 indent-column) (insert " ") (setq indent-column (- indent-column 1)))))) ;;; Indent-style functions (defun cssm-old-style-indenter(position column first-char-on-line) (cond ((eq position 'inside-atmedia) (if (string= "}" first-char-on-line) 0 cssm-indent-level)) ((eq position 'inside-rule) (+ column 2)) ((eq position 'inside-rule-and-atmedia) (+ column 2)) ((eq position 'inside-comment) (+ column 3)) ((eq position 'outside) 0))) (defun cssm-c-style-indenter(position column first-char-on-line) (cond ((or (eq position 'inside-atmedia) (eq position 'inside-rule)) (if (string= "}" first-char-on-line) 0 cssm-indent-level)) ((eq position 'inside-rule-and-atmedia) (if (string= "}" first-char-on-line) cssm-indent-level (* 2 cssm-indent-level))) ((eq position 'inside-comment) (+ column 3)) ((eq position 'outside) 0))) ;;; Typing shortcuts (define-skeleton cssm-insert-curlies "Inserts a pair of matching curly parenthesises." nil "{" (if cssm-newline-before-closing-bracket "\n" " ") (if cssm-newline-before-closing-bracket '>) _ (if cssm-newline-before-closing-bracket "\n" " ") "}" (if cssm-newline-before-closing-bracket '>)) (define-skeleton cssm-insert-quotes "Inserts a pair of matching quotes." nil "\"" _ "\"") (define-skeleton cssm-insert-parenthesises "Inserts a pair of matching parenthesises." nil "(" _ ")") (define-skeleton cssm-insert-comment "Inserts a full comment." nil "/* " _ " */") (define-skeleton cssm-insert-url "Inserts a URL." nil "url(" _ ")") (define-skeleton cssm-insert-brackets "Inserts a pair of matching brackets." nil "[" _ "]") (defun cssm-enter-mirror-mode() "Turns on mirror mode, where quotes, brackets etc are mirrored automatically on insertion." (interactive) (define-key cssm-mode-map (read-kbd-macro "{") 'cssm-insert-curlies) (define-key cssm-mode-map (read-kbd-macro "\"") 'cssm-insert-quotes) (define-key cssm-mode-map (read-kbd-macro "(") 'cssm-insert-parenthesises) (define-key cssm-mode-map (read-kbd-macro "[") 'cssm-insert-brackets)) (defun cssm-leave-mirror-mode() "Turns off mirror mode." (interactive) (define-key cssm-mode-map (read-kbd-macro "{") 'self-insert-command) (define-key cssm-mode-map (read-kbd-macro "\"") 'self-insert-command) (define-key cssm-mode-map (read-kbd-macro "(") 'self-insert-command) (define-key cssm-mode-map (read-kbd-macro "[") 'self-insert-command)) ;;; Property completion (defun cssm-property-at-point() "If point is at the end of a property name: returns it." (let ((end (point)) (start (+ (re-search-backward "[^-A-Za-z]") 1))) (goto-char end) (buffer-substring start end))) ; internal (defun cssm-maximum-common(alt1 alt2) "Returns the maximum common starting substring of alt1 and alt2." (let* ((maxlen (min (length alt1) (length alt2))) (alt1 (substring alt1 0 maxlen)) (alt2 (substring alt2 0 maxlen))) (while (not (string= (substring alt1 0 maxlen) (substring alt2 0 maxlen))) (setq maxlen (- maxlen 1))) (substring alt1 0 maxlen))) ; internal (defun cssm-common-beginning(alts) "Returns the maximum common starting substring of all alts elements." (let ((common (car alts))) (dolist (alt (cdr alts) common) (setq common (cssm-maximum-common alt common))))) (defun cssm-complete-property-frame(completions) ; This code stolen from message.el. Kudos to larsi. (let ((cur (current-buffer))) (pop-to-buffer "*Completions*") (buffer-disable-undo (current-buffer)) (let ((buffer-read-only nil)) (erase-buffer) (let ((standard-output (current-buffer))) (display-completion-list (sort completions 'string<))) (goto-char (point-min)) (pop-to-buffer cur)))) (defun cssm-complete-property() "Completes the CSS property being typed at point." (interactive) (let* ((prop (cssm-property-at-point)) (alts (all-completions prop cssm-properties-alist)) (proplen (length prop))) (if (= (length alts) 1) (insert (substring (car alts) proplen)) (let ((beg (cssm-common-beginning alts))) (if (not (string= beg prop)) (insert (substring beg proplen)) (insert (substring (completing-read "Property: " cssm-properties-alist nil nil prop) proplen))))))) (defun css-mode() "Major mode for editing CSS style sheets. \\{cssm-mode-map}" (interactive) ; Initializing (kill-all-local-variables) ; Setting up indentation handling (make-local-variable 'indent-line-function) (setq indent-line-function 'cssm-indent-line) ; Setting up font-locking (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(cssm-font-lock-keywords nil t nil nil)) ; Setting up typing shortcuts (make-local-variable 'skeleton-end-hook) (setq skeleton-end-hook nil) (when cssm-mirror-mode (cssm-enter-mirror-mode)) (use-local-map cssm-mode-map) ; Setting up syntax recognition (make-local-variable 'comment-start) (make-local-variable 'comment-end) (make-local-variable 'comment-start-skip) (setq comment-start "/* " comment-end " */" comment-start-skip "/\\*[ \n\t]+") ; Setting up syntax table (modify-syntax-entry ?* ". 23") (modify-syntax-entry ?/ ". 14") ; Final stuff, then we're done (setq mode-name "CSS" major-mode 'css-mode) (run-hooks 'css-mode-hook)) (provide 'css-mode) ;; CSS-mode ends here ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 20:05 ` Edward Welbourne @ 2007-07-25 7:59 ` martin rudalics 0 siblings, 0 replies; 27+ messages in thread From: martin rudalics @ 2007-07-25 7:59 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs >>Apparently, Zaitseff's modifications are too persistent but I can't tell >>anything because I don't have the sources. > > > Source follows, Thanks. Basically, the problem is here (defun css-mode() ... ; Setting up syntax table (modify-syntax-entry ?* ". 23") (modify-syntax-entry ?/ ". 14") ... This will modify the syntax-table of the current buffer, which can be any syntax table. You can, for example, in *scratch* do M-x css-mode and you will get C-like comments in all your Elisp buffers. Weird. Maybe this stuff works in a mmm-like environment where a buffer may have multiple major modes. As it stands, the code above is highly dangerous and should be either fixed (by making a new syntax table) or removed. In any case it was useful to do these investigations. Thank you for the collaboration. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 16:47 ` martin rudalics 2007-07-24 20:05 ` Edward Welbourne @ 2007-07-24 20:42 ` Edward Welbourne 2007-07-24 21:53 ` Lennart Borgman (gmail) 2 siblings, 0 replies; 27+ messages in thread From: Edward Welbourne @ 2007-07-24 20:42 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs > In any case this should be reported to the Debian bug tracking > system since probably more people might be affected by this. Bug address: 434556@bugs.debian.org URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=434556 Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 16:47 ` martin rudalics 2007-07-24 20:05 ` Edward Welbourne 2007-07-24 20:42 ` Edward Welbourne @ 2007-07-24 21:53 ` Lennart Borgman (gmail) 2007-07-24 22:05 ` Dan Nicolaescu 2 siblings, 1 reply; 27+ messages in thread From: Lennart Borgman (gmail) @ 2007-07-24 21:53 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs, eddy martin rudalics wrote: > > (defvar cssm-version "0.11.zap1" > > "The current version number of css-mode.") > > ;;; copyright (c) 1998 Lars Marius Garshol, larsga@ifi.uio.no > > ;;; $Id: css-mode.el,v 1.9 2000/01/05 21:21:56 larsga Exp $ > > ;;; Modified by John Zaitseff, 3rd November 2004. > > css-mode by Garshol, modified by Zaitseff, and distributed by Debian. > Apparently, Zaitseff's modifications are too persistent but I can't tell > anything because I don't have the sources. In any case this should be > reported to the Debian bug tracking system since probably more people > might be affected by this. And Stefan Monnier's css-mode.el ought to be included in Emacs as soon as possible I believe. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 21:53 ` Lennart Borgman (gmail) @ 2007-07-24 22:05 ` Dan Nicolaescu 2007-07-25 8:19 ` martin rudalics 0 siblings, 1 reply; 27+ messages in thread From: Dan Nicolaescu @ 2007-07-24 22:05 UTC (permalink / raw) To: Lennart Borgman (gmail); +Cc: bug-gnu-emacs, eddy "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes: > martin rudalics wrote: > > > (defvar cssm-version "0.11.zap1" > > > "The current version number of css-mode.") > > > ;;; copyright (c) 1998 Lars Marius Garshol, larsga@ifi.uio.no > > > ;;; $Id: css-mode.el,v 1.9 2000/01/05 21:21:56 larsga Exp $ > > > ;;; Modified by John Zaitseff, 3rd November 2004. > > > > css-mode by Garshol, modified by Zaitseff, and distributed by Debian. > > Apparently, Zaitseff's modifications are too persistent but I can't tell > > anything because I don't have the sources. In any case this should be > > reported to the Debian bug tracking system since probably more people > > might be affected by this. > > And Stefan Monnier's css-mode.el ought to be included in Emacs as soon > as possible I believe. It already is, both CVS HEAD and 22.2 branch. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 22:05 ` Dan Nicolaescu @ 2007-07-25 8:19 ` martin rudalics 2007-07-25 8:48 ` Edward Welbourne 0 siblings, 1 reply; 27+ messages in thread From: martin rudalics @ 2007-07-25 8:19 UTC (permalink / raw) To: Dan Nicolaescu; +Cc: eddy, bug-gnu-emacs > > And Stefan Monnier's css-mode.el ought to be included in Emacs as soon > > as possible I believe. > > It already is, both CVS HEAD and 22.2 branch. This won't help in the OP's case, because site-lisp's css-mode might be loaded after Stefan's. The problem must be fixed by Debian first. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-25 8:19 ` martin rudalics @ 2007-07-25 8:48 ` Edward Welbourne 0 siblings, 0 replies; 27+ messages in thread From: Edward Welbourne @ 2007-07-25 8:48 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs, dann > > > And Stefan Monnier's css-mode.el ought to be included in Emacs as soon > > > as possible I believe. > > > > It already is, both CVS HEAD and 22.2 branch. > This won't help in the OP's case, because site-lisp's css-mode might be > loaded after Stefan's. The problem must be fixed by Debian first. well, once Emacs22 is released with its own css-mode built in, one of the ways Debian can fix this is by saying Emacs22 Conflicts: css-mode, since it supplies its own and css-mode is broken ... I've now tested with Emacs21: although I never saw this problem before upgrading to Emacs22, I see that the bug is just as present in Emacs21. I'll tell the Debian bug that it should be against css-mode ! Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 13:51 ` Edward Welbourne 2007-07-24 14:51 ` Lennart Borgman (gmail) @ 2007-07-24 16:44 ` martin rudalics 1 sibling, 0 replies; 27+ messages in thread From: martin rudalics @ 2007-07-24 16:44 UTC (permalink / raw) To: eddy; +Cc: bug-gnu-emacs > So, steps to reproduce: in an emacs -q session evaluate <quote> > (autoload 'html-mode "sgml-mode" "Edit HTML docs" t) > (setq auto-mode-alist (cons (cons "\\.x?html?$" 'html-mode) auto-mode-alist)) > </quote>, visit a .css file (it need not exist / can be empty), > open a .html file containing: <quote> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> > <html lang="en"><head><title>Test page for HTML-mode /* comment issue </title><!-- */ sanity > --></head><body><h1>Test page for HTML-mode /* comment issue </h1><!-- */ sanity --></body></html> > </quote> > > It would appear that css-mode is hacking html-mode ! But this is not the css-mode that comes with Emacs 22.2. ^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: C-comments in sgml-mode's html-mode 2007-07-24 13:01 ` martin rudalics 2007-07-24 13:51 ` Edward Welbourne @ 2007-07-24 14:39 ` Edward Welbourne 1 sibling, 0 replies; 27+ messages in thread From: Edward Welbourne @ 2007-07-24 14:39 UTC (permalink / raw) To: martin rudalics; +Cc: bug-gnu-emacs Further to successful reproduction, I've now simplified reproducing this even further - css-mode is even hacking GNUMakefile-mode ! run: emacs -q dummy.css dummy.mk In dummy.mk's buffer, type <quote> /* I look like a comment but I don't </quote> and you'll see it's true ! Eddy. ^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2007-07-25 8:48 UTC | newest] Thread overview: 27+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-07-19 11:33 M-x compile re-uses name of old compilation buffer, contrary to documentation Edward Welbourne 2007-07-20 13:42 ` Richard Stallman 2007-07-20 14:54 ` Edward Welbourne 2007-07-21 10:23 ` martin rudalics 2007-07-23 11:50 ` C-comments in sgml-mode's html-mode Edward Welbourne 2007-07-23 12:02 ` Lennart Borgman (gmail) 2007-07-23 13:24 ` Edward Welbourne 2007-07-23 14:51 ` martin rudalics 2007-07-23 17:49 ` Edward Welbourne 2007-07-23 12:27 ` martin rudalics 2007-07-23 16:59 ` Edward Welbourne 2007-07-23 18:41 ` martin rudalics 2007-07-24 8:57 ` Edward Welbourne 2007-07-24 13:01 ` martin rudalics 2007-07-24 13:51 ` Edward Welbourne 2007-07-24 14:51 ` Lennart Borgman (gmail) 2007-07-24 15:46 ` Edward Welbourne 2007-07-24 16:47 ` martin rudalics 2007-07-24 20:05 ` Edward Welbourne 2007-07-25 7:59 ` martin rudalics 2007-07-24 20:42 ` Edward Welbourne 2007-07-24 21:53 ` Lennart Borgman (gmail) 2007-07-24 22:05 ` Dan Nicolaescu 2007-07-25 8:19 ` martin rudalics 2007-07-25 8:48 ` Edward Welbourne 2007-07-24 16:44 ` martin rudalics 2007-07-24 14:39 ` Edward Welbourne
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.