简体   繁体   中英

Subword/Transient-Mark Highlighting Issues in Emacs

I have Global Subword Mode enabled, but I am trying to get Ctrl+Left/Right to travel by subwords in place of the full word default of left/right-word (the default commands for those keys).

It works as expected if I simply rebind the keys, except for one case: If I try to "transient-mark" using Ctrl+Shift+Right , rather than marking the full word like right-word does, the point is moved to the next subword without creating a region.

Is this due to Subword Mode? I would like to know if I can somehow combine some of the normal features of left/right-word like marking with the movement of Subword Mode.

IMHO this is indeed a problem with subword-mode . You can fix it by doing:

(defadvice subword-backward (before handle-shift-selection activate)
  (handle-shift-selection))

(defadvice subword-forward (before handle-shift-selection activate)
  (handle-shift-selection))

But my advice is to do also a Mx report-emacs-bug so this can be properly fixed in next release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM