Code Monkey home page Code Monkey logo

Comments (5)

jiegec avatar jiegec commented on June 4, 2024

(xxx-mode t)和(xxx-mode)不一样。前者turn on 后者toggle。在这里一样。我自己写了个宏来处理这个问题,用数字1和-1。

from spacemacs-rocks.

jiegec avatar jiegec commented on June 4, 2024

Note that ' matches the end of a string, where as $ matches the empty string before a newline. Thus, $ may lead to unexpected behavior when dealing with filenames containing newlines. (Should be pretty rare… ;))

backtick同理。

boundary anchors
Pattern Matches
^… Beginning of {line, string, buffer}
…$ End of {line, string, buffer}
`… Beginning of {string, buffer}
…' End of {string, buffer}
\b word boundary marker

from spacemacs-rocks.

 avatar commented on June 4, 2024
  1. Eli 是我写错了。
  2. 所有文中的 Emacs Lisp 的注释均使用 ;;
  3. (xxx-mode t) 我马上会将文字版中的 t 全部换成 1 来统一格式。

from spacemacs-rocks.

xuchunyang avatar xuchunyang commented on June 4, 2024

(xxx-mode t)和(xxx-mode)不一样。前者turn on 后者toggle。在这里一样。我自己写了个宏来处理这个问题,用数字1和-1。

这两者是一样的(如果不一样的话,证据是什么?)

(delete-selection-mode)
    ⇒ t

(delete-selection-mode t)
    ⇒ t

(delete-selection-mode 'toggle)
    ⇒ nil

从 Lisp 调用和交互式调用,对参数的解释不一样,这里我们讨论的是前者。

Note that ' matches the end of a string, where as $ matches the empty string before a newline. Thus, $ may lead to unexpected behavior when dealing with filenames containing newlines. (Should be pretty rare… ;))

清楚一些了。(引用自哪里?)

from spacemacs-rocks.

jiegec avatar jiegec commented on June 4, 2024

引用自EmacsWiki AutoModeList。下面的表来自Xah Emacs。

       ;; The actual function.
       (defun ,modefun (&optional arg ,@extra-args)
     ,(or doc
          (format (concat "Toggle %s on or off.
With a prefix argument ARG, enable %s if ARG is
positive, and disable it otherwise.  If called from Lisp, enable
the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
\\{%s}") pretty-name pretty-name keymap-sym))
     ;; Use `toggle' rather than (if ,mode 0 1) so that using
     ;; repeat-command still does the toggling correctly.
     (interactive (list (or current-prefix-arg 'toggle)))

恩,不过有的地方(比如hydra)会调用funcall-interactively。要小心。

           (,@setter
            (if (eq arg 'toggle)
                (not ,getter)
              ;; A nil argument also means ON now.
              (> (prefix-numeric-value arg) 0)))

所以还是-1稳妥。

from spacemacs-rocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.