标记不会从对齐,正则表达式指向任何(Emacs的) [英] Marker does not point anywhere from align-regexp (Emacs)

查看:203
本文介绍了标记不会从对齐,正则表达式指向任何(Emacs的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在调用一个调整 - 用正则表达式的标志麻烦。不知怎的,这并不工作,并给出了错误标记不指向任何地方

函数的想法是,它搜索一个新段,将其标记,然后执行的align-正则表达式就可以了。为什么不工作?

 (defun函数cleanR-ALIGN-smallerthan破折号()
  (互动)
  (节省冲程
    (GOTO-CHAR(点分))
    (而(搜索前进,正则表达式[\ n]的[\ n]的无T);确认工作
      (标记段);误差可能是在这里
      (调整-正则表达式(区域开头)(区端)<  - ))))
 

解决方案

您传递的正则表达式是不是调整 - 正则表达式期待。

请参阅我的答案这里

I am having trouble with the marker in calling an align-regexp. Somehow this doesn't work and gives the error "Marker does not point anywhere".

The idea of the function is that it searches for a new paragraph, marks it and then performs the align-regexp on it. Why doesn't it work?

(defun cleanR-align-smallerthan-dash ()
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (while (search-forward-regexp "[\n][\n]" nil t) ; confirmed to work
      (mark-paragraph)                            ; the error is probably in here
      (align-regexp (region-beginning) (region-end) "<-"))))

解决方案

The regexp you passed is not what align-regexp is expecting.

See my answer here.

这篇关于标记不会从对齐,正则表达式指向任何(Emacs的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆