unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ross Patterson <me@rpatterson.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-pretest-bug@gnu.org, 2034@emacsbugs.donarmstrong.com
Subject: bug#2034: 23.0.60; c-subword-mode incompatible with xml-mode
Date: Sun, 25 Jan 2009 10:48:36 -0800	[thread overview]
Message-ID: <878wozxlvf.fsf@transitory.lefae.org> (raw)
In-Reply-To: <jwvy6wzs86b.fsf-monnier+emacsbugreports@gnu.org> (Stefan Monnier's message of "Sun, 25 Jan 2009 10:44:44 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Running "M-x c-subword-mode" in a buffer using xml-mode will raise the
>> following error:
>
>> c-update-modeline: Wrong type argument: stringp, (sgml-xml-mode "XML" "SGML")
>
> c-subword-mode is obviously written specifically for modes provided by
> the cc-*.el files.  It may accidentally work in some other modes, but at
> least c-update-modeline makes several assumptions about the format used
> for `mode-name'.

Well I find it very useful to use c-subword-mode in pretty much all my
buffers.  Here's the patched version of this function I'm using to work
around this issue:

(defun c-update-modeline ()
  (let* ((fmt (format "/%s%s%s%s"
                      (if c-electric-flag "l" "")
                      (if (and c-electric-flag c-auto-newline)
                          "a" "")
                      (if c-hungry-delete-key "h" "")
                      (if (and
                           ;; cc-subword might not be loaded.
                           (boundp 'c-subword-mode)
                           (symbol-value 'c-subword-mode))
                          "w"
                        "")))
         (str-mode-name (if (listp mode-name)
                            (nth 1 mode-name)
                          mode-name))
         (bare-mode-name (if (string-match "\\(^[^/]*\\)/" str-mode-name)
                             (substring str-mode-name (match-beginning 1) (match-end 1))
                           str-mode-name)))
    ;;     (setq c-submode-indicators
    ;; 	  (if (> (length fmt) 1)
    ;; 	      fmt))
    (setq mode-name
          (if (> (length fmt) 1)
              (concat bare-mode-name fmt)
            bare-mode-name))
    (force-mode-line-update)))

Ross






  reply	other threads:[~2009-01-25 18:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8cbpgkqwkt.fsf@fencepost.gnu.org>
2009-01-25  2:10 ` bug#2034: 23.0.60; c-subword-mode incompatible with xml-mode me
2009-01-25 15:44   ` Stefan Monnier
2009-01-25 18:48     ` Ross Patterson [this message]
2010-01-23 22:36   ` bug#2034: marked as done (23.0.60; c-subword-mode incompatible with xml-mode) Emacs bug Tracking System
2018-07-02 12:40   ` bug#2034: [PATCH] 27.0.50; Support mode line constructs for `mode-name' in c-mode Phil Sainty
2018-07-02 15:29     ` Eli Zaretskii
2018-07-02 22:53       ` Phil Sainty
2018-07-03 13:37         ` Phil Sainty
2018-07-04  2:41         ` Eli Zaretskii
     [not found]   ` <mailman.3006.1530625089.1292.bug-gnu-emacs@gnu.org>
2018-07-04 20:11     ` Alan Mackenzie
2018-07-04 21:13       ` Phil Sainty
2018-07-08  2:46         ` Phil Sainty
2018-07-08 20:08         ` Alan Mackenzie
2018-07-09 14:47           ` Phil Sainty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878wozxlvf.fsf@transitory.lefae.org \
    --to=me@rpatterson.net \
    --cc=2034@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).