我目前正在为Tomcat容器中的现有J2EE webapp添加功能,我正在使用Clojure编写我的添加内容.我的设置很简单:我只是添加对clojure生成的静态方法的调用,并编写来自clojure方面的所有艰苦工作.构建过程包括编译clojure代码(lein uberjar),然后在类路径上使用该jar编译java代码.
在webapp init中,我调用了一个生成的类,该类使用a激活swank服务器(swank/start-repl).我希望能够将我的Aquamacs的粘液连接到该服务器,并从那里以交互方式工作(直到某一点,我不会尝试任何需要java端重新编译的东西).但我有一种我不太明白的情况.如果我这样做\M-x slime-connect,我会得到一个REPL提示符(在收到通知后没有低级的lisp进程,我认为没关系,因为劣质的lisp进程在emacs控制之外运行).我可以完美地评估表格,我甚至可以检查类似的东西my.own.namespace/my-var.但是,如果我访问一个已经编译过的clojure代码的文件,我似乎无法让slime认出它作为它的来源.考虑一个简单的clojure文件:
(ns my.namespace
(:gen-class
:name my.namespace
:methods [#^{:static true} [testFunc [] void]]))
(def *secret* "shhhh")
(defn -testFunc []
(println (str "our secret is: " secret)))
Run Code Online (Sandbox Code Playgroud)
假设这是编译并包含在webapp加载的uberjar中,我可以进行评估/检查my.namespace/*secret*.但是如果我尝试在代码缓冲区内进行评估,那么Slime认为我在user命名空间中(甚至可以理解!).但现在我只剩下一个工作选项了 - 我必须逐一评估文件中的所有表格!\C-c \C-l(加载源文件)将不会做任何事情 - 显然只返回nil并输出其他内容.编译所有内容似乎就是这样 - 它编译,如果找到它们会显示错误,但不会更改我的命名空间.而最奇怪的是\C-~(同步包和目录),它使用Common Lisp它正是我想要的,但在这里它冻结了clojure REPL.
总是可以选择切换到REPL,打字(in-ns 'my.namespace),然后一切正常.但是当clojure文件数量增加时,这根本不够实用(因为代码缓冲区的命名空间不会自动更改!)
我的问题是,我是否缺乏基本的命令/配置 - 或者是否有明显的原因导致这种行为发生.
我正在使用德语键盘在Macbook上使用Aquamacs.我已经设置了"元和德语"选项,以使alt/option键Alt在需要时工作,但Meta另有说明.到现在为止还挺好.现在我想调用绑定到C-c [(reftex-citation)的函数.不幸的是,我现在已经知道如何键入这个:在德语键盘上方括号被绑定Alt-5,但显然在C-c下面的alt /选项被Aquamacs解释为Meta(或完全不同的东西),因为当我键入C-c后跟Alt-5我收到消息:^C ?5 is undefined.有没有办法让我获得方括号C-c?
(在这种特殊情况下,我只是反弹reftex-citation到另一个键,所以没什么大不了的,但我现在已经在几个变种中遇到了问题,所以我想我会发现我在做什么或者错误地理解.)
我非常喜欢Xcode黄昏色主题,我试图为我的Aquamacs/Emacs获得类似的东西.我似乎找不到任何东西.感谢任何帮助!
我习惯在Mac OS X上按Alt + N来编写一个〜字符.这在Emacs中不起作用.Alt + N键似乎绑定到命令历史记录.所以我的问题是如何在Mac OS X上的Emacs中编写一个〜字符?
编辑:我正在使用Aquamacs.
如何让aquamacs显示稳固闪烁的光标? http://aquamacs.org/
通过大量的工作,我们设法让它显示一个空心闪烁的盒子,而不仅仅是一条闪烁的垂直线,但这通常太难看了.
Aquamacs默认html-helper-mode编辑.html具有奇怪行为的文件.我想html-mode默认切换回常规.
我读到我需要改变 magic-mode-alist这样做.根据我从文档中的理解,将此添加到我.emacs应该做的交易:
(setq magic-mode-alist '(("\\.html" . html-mode)))
Run Code Online (Sandbox Code Playgroud)
不幸的是它没有改变任何东西.我在其他地方读过,设置它nil应该可以工作,但它也没有.
知道我错过了什么吗?
提前致谢.
运行AquaEmacs,我想在Python中执行缓冲区(Cc Cc).
缓冲区以:
from __future__ import print_function
Run Code Online (Sandbox Code Playgroud)
AquaEmacs中的执行始于:
import sys,imp
if'test_one_liners' in sys.modules:
imp.reload(test_one_liners)
else:
import test_one_liners
Run Code Online (Sandbox Code Playgroud)
其中test_one_liners.py是我的文件.这给出了这个错误:
SyntaxError: from __future__ imports must occur at the beginning of the file
Run Code Online (Sandbox Code Playgroud)
有谁知道在哪里以及如何解决这个问题?
让我再次添加信息以表明清楚.
创建此缓冲区:
from __future__ import print_function
print("Hello")
Run Code Online (Sandbox Code Playgroud)
使用文件/更改缓冲模式/ Python使Python和Cc Cc执行它; 它不需要保存.缓冲区被写入一些临时文件并失败SyntaxError: from __future__ imports must occur at the beginning of the file.回溯包括生成的文件,其中包含对临时文件的引用.怎么会发生打印你好.
升级到Aquamacs 3.3版(emacs 25.1.1)后,我在运行时遇到标题中提到的错误re-replace-region(定义如下),尝试更改区域中的9s字符串(例如"99"或"999") )到0.我以前从未遇到过Aquamacs(或者通常是emacs)的早期版本的问题,而且在emacs环境或一般的机器环境(Mac OS 10.9.5)中我无法想到任何可能与之相关的问题.问题.
事实上,我在同一台机器上有一个emacs可执行文件(版本22.1.1),并且在相同的环境中调用它之后(例如,相同的〜/ .emacs等),re-replace-region它可以正常工作.
我可以提供的唯一其他线索是,当在一个区域中运行重新替换区域时,如果在其中有三个9(999),尝试将9更改为0,则在引发错误条件之前更改前9个.
这是defun:
;;; RE-REPLACE-REGION replaces OLD (a regular expression) with NEW
;;; throughout the region indicated by BEGIN and END.
;;; For example, to insert a prefix ">" at the beginning of each line
;;; in the region:
;;; M-x re-replace-regionRET^RET>RET
;;; I don't know who wrote this function!
(defun re-replace-region (begin end old new)
"Replace occurrences of REGEXP with TO-STRING in region."
(interactive "*r\nsReplace string: \nswith: ") …Run Code Online (Sandbox Code Playgroud) 我使用Aquamacs和TeX Live 2009来编辑我的LaTeX文件.由于我的出版物往往变得很大,我想构建包含所有LaTeX文件的源文件夹.比如说
可以%%% TeX-master: "main"在每个"子"文件的末尾定义局部变量,以定义包含所有标题等的主文件.如果子文件与主文件位于同一目录中,则可以正常工作.如果我尝试在这里定义主文件(例如,chapter1.tex中的main.tex),LaTeX找不到指定的文件.
在这种情况下我该怎么办?
我正在尝试配置Aquamacs以使用曝光的主题.我已经配置了使用erlang的aquamacs,并且工作正常.尝试将自定义主题添加到加载路径后,启动aquamacs时出现以下错误:
Symbol's value as variable is void: custom-theme-load-path
Run Code Online (Sandbox Code Playgroud)
我是emacs的新手,我几乎所有的东西都在跳过篮球,这令我震惊.我已经将路径重复了两万次,所以我可能只是不理解如何正确添加主题路径.
这是我的~/.emacs-old.el文件,其中aquamacs使用:
(setq load-path (cons"/usr/local/Cellar/erlang/R15B01/lib/erlang/lib/tools-2.6.7/emacs" load-path))
(setq erlang-root-dir "/usr/local/Cellar/erlang/R15B01/lib/erlang/lib")
(setq exec-path (cons "/usr/local/Cellar/erlang/R15B01/lib/erlang/bin" exec-path))
(require 'erlang-start)
(add-to-list 'custom-theme-load-path "~/.emacs.d/emacs-color-theme-solarized/")
(load-theme 'solarized-[light|dark] t)
Run Code Online (Sandbox Code Playgroud)
这是从我的终端打印出来的文件列表和路径:
Daniel:emacs-color-theme-solarized daniel$ pwd
/Users/daniel/.emacs.d/emacs-color-theme-solarized
Daniel:emacs-color-theme-solarized daniel$ ls -l
total 208
-rw-r--r-- 1 daniel staff 1061 Mar 4 14:04 LICENSE
-rw-r--r-- 1 daniel staff 8744 Mar 4 14:04 README.md
drwxr-xr-x 7 daniel staff 238 Mar 4 14:20 color-theme-solarized-20130304
-rw-r--r-- 1 daniel staff 36864 Mar 4 14:20 color-theme-solarized-20130304.tar
-rw-r--r-- …Run Code Online (Sandbox Code Playgroud)