all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#1593: ruby-mode: problems with font-lock
@ 2008-12-16 11:06 Pietro Giorgianni
  2011-10-04 22:01 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Pietro Giorgianni @ 2008-12-16 11:06 UTC (permalink / raw
  To: bug-gnu-emacs

The syntax  %{#{'?'}} , while legal (it is equivalent to '?'), makes
all the following text appear in font-lock-string-face.

The same happens with %{#{"?"}} , and seems to rise from the ?" or ?'
part: if I put a space (or whatever) after the ? , things work.

Real life example (from the sources of rubyonrails):

self.class_eval %{
  def self.#{method_id}(*args)
    guard_protected_attributes = false

    if args[0].is_a?(Hash)
      guard_protected_attributes = true
      attributes = args[0].with_indifferent_access
      find_attributes = attributes.slice(*[:#{attribute_names.join(',:')}])
    else
      find_attributes = attributes =
construct_attributes_from_arguments([:#{attribute_names.join(',:')}],
args)
    end

    options = { :conditions => find_attributes }
    set_readonly_option!(options)

    record = find_initial(options)

     if record.nil?
      record = self.new { |r| r.send(:attributes=, attributes,
guard_protected_attributes) }
      #{'yield(record) if block_given?'}
      #{'record.save' if instantiator == :create}
      record
    else
      record
    end
  end
}, __FILE__, __LINE__


---

In GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600)
 of 2008-09-06 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

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: ITA
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Ruby

Minor modes in effect:
  erc-log-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-highlight-nicknames-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-readonly-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  display-time-mode: t
  encoded-kbd-mode: t
  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
  column-number-mode: t
  line-number-mode: t

Recent input:
c e n s o r e d


Recent messages:
censored...
Loading emacsbug...done







^ permalink raw reply	[flat|nested] 3+ messages in thread
* bug#1593: ruby-mode: problems with font-lock
@ 2008-12-20  7:37 Chong Yidong
  0 siblings, 0 replies; 3+ messages in thread
From: Chong Yidong @ 2008-12-20  7:37 UTC (permalink / raw
  To: Phil Hagelberg; +Cc: 1593, Pietro Giorgianni

Hi Phil,

If you have time, could you take a look at this bug report?  Thanks.

"Pietro Giorgianni" <giorgian@gmail.com> wrote:

  The syntax  %{#{'?'}} , while legal (it is equivalent to '?'), makes
  all the following text appear in font-lock-string-face.

  The same happens with %{#{"?"}} , and seems to rise from the ?" or ?'
  part: if I put a space (or whatever) after the ? , things work.

  Real life example (from the sources of rubyonrails):

  self.class_eval %{
    def self.#{method_id}(*args)
      guard_protected_attributes = false

      if args[0].is_a?(Hash)
        guard_protected_attributes = true
        attributes = args[0].with_indifferent_access
        find_attributes =
        attributes.slice(*[:#{attribute_names.join(',:')}])
      else
        find_attributes = attributes = construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args)
      end

      options = { :conditions => find_attributes }
      set_readonly_option!(options)

      record = find_initial(options)

       if record.nil?
        record = self.new { |r| r.send(:attributes=, attributes, guard_protected_attributes) }
        #{'yield(record) if block_given?'}
        #{'record.save' if instantiator == :create}
        record
      else
        record
      end
    end
  }, __FILE__, __LINE__






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

end of thread, other threads:[~2011-10-04 22:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16 11:06 bug#1593: ruby-mode: problems with font-lock Pietro Giorgianni
2011-10-04 22:01 ` Glenn Morris
  -- strict thread matches above, loose matches on Subject: below --
2008-12-20  7:37 Chong Yidong

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.