10
文字列が既にEmacs Lispのリストに入っているかどうかを確認するにはどうすればよいですか?特定のパス文字列が既にexec-pathにあるかどうかを確認し、そうでなければそのリストに追加する必要があります。ありがとう!Emacs Lisp:リスト項目を重複して挿入するのを避けるには?
文字列が既にEmacs Lispのリストに入っているかどうかを確認するにはどうすればよいですか?特定のパス文字列が既にexec-pathにあるかどうかを確認し、そうでなければそのリストに追加する必要があります。ありがとう!Emacs Lisp:リスト項目を重複して挿入するのを避けるには?
機能追加・ツー・リスト(4 1 2 3)
章Fからに等しいa
もたらす
(setq a '(1 2 3))
(add-to-list 'a 4)
(add-to-list 'a 3)
を添加する前に自動的にチェックする追加ツーリスト:
add-to-list is a compiled Lisp function in `subr.el'. (add-to-list list-var element &optional append compare-fn) Add element to the value of list-var if it isn't there yet. The test for presence of element is done with `equal', or with compare-fn if that's non-nil. If element is added, it is added at the beginning of the list, unless the optional argument append is non-nil, in which case element is added at the end. The return value is the new value of list-var. If you want to use `add-to-list' on a variable that is not defined until a certain package is loaded, you should put the call to `add-to-list' into a hook function that will be run only after loading the package. `eval-after-load' provides one way to do this. In some cases other hooks, such as major mode hooks, can do the job.
これは素晴らしいです!ありがとう! –