swift-emacs / swift-mode

Emacs support for Apple's Swift programming language.
GNU General Public License v3.0
363 stars 47 forks source link

mark-sexp marks more than sexp within comment blocks #154

Open vellvisher opened 5 years ago

vellvisher commented 5 years ago

Example code with cursor as []:

  // []Start my application.  
  public func application(

Hit C-M-SPC, C-M-@ or mark-sexp, marked region in between []

  // [Start my application.  
  public] func application(

Expected (eg from objc-mode)

  // [Start] my application.  
  public func application(
taku0 commented 5 years ago

mark-sexp and forward/backward-sexp assume the point is not in a comment or string. We can define some reasonable behavior for such situation. forward-sexp-function is not defined for fundamental-mode nor text-mode. So we must define what is a expected behavior: