asdf:make-build on Windows fails - windows

I have the following files
example.asd:
(defsystem example
:serial t
:components ((:file "first")
(:file "second")))
first.lisp:
(defun first-print-hello ()
(format t "Hello from first.lisp!~%"))
second.lisp:
(format t "Hello from second.lisp!~%")
(first-print-hello)
I can successfully load the system, but doing (asdf:make-build :example :type :program :move-here ".") gives the following error:
LINK : fatal error LNK1149: output filename matches input filename 'C:\path\to\example.lib'
Is there something I'm not configuring properly? It seems to be creating example.lib, then making example.exe link example.lib, and cl does not like them being named the same. Is there a way to specify the name of the resulting executable? Or is this just a bug in ECL's asdf:make-build?
I'm using ECL on Windows 10 with Visual Studio 2015's developer tools.

Don't use make-build, use (asdf:operate :program-op "example")
Or don't use :move-here "."

Related

ASDF on Windows 7 cannot load the ASD file using CLISP or SBCL

On my Windows 7 CLISP 2.49 and SBCL-1.4.14 are installed and they work perfectly. ASDF 3.3.1 is loaded by the these lines on .sbclrc or .clisprc
(load "C:\\Users\\mayhem\\lisp\\asdf\\asdf.lisp")
(require :asdf)
(push "C:\\Users\\mayhem\\lisp\\systems\\" asdf:*central-registry*)
I'd like to load and use the iterate package/library using ASDF (not QuickLisp) so I've installed the iterate into C:\Users\mayhem\lisp\iterate and on CMD.exe
> cd C:\Users\mayhem\lisp\systems
> junction.exe iterate.asd C:\Users\mayhem\lisp\iterate\iterate.asd
If I (require 'iterate) whether on REPL or in a file, I get
CLISP: *** - LOAD: A file with name ITERATE does not exist
SBCL: ASDF could not load iterate because Error while trying to load definition for system iterate from pathname C:/Users/mayhem/lisp/systems/iterate.asd/: error opening #P"C:/Users/mayhem/lisp/systems/iterate.asd/": Access denied..
While evaluating the form starting at line 1, column 0
of #P"C:/Users/mayhem/lisp/defsystem.lisp":
If I try to load the iterate.asd directly then I get
EVAL: undefined function DEFSYSTEM
How to fix the problem?
Update 1:
I've added (push "C:\\Users\\mayhem\\lisp\\iterate\\" asdf:*central-registry*) into .sbclrc. That is, I did the loading of iterate.asd without relying on soft links. When I entered (require 'iterate) on REPL it gave:
(require 'iterate)
ASDF could not load iterate because
Uneven number of components in source to destination mapping: "C:/".
....
(ASDF/OUTPUT-TRANSLATIONS:PARSE-OUTPUT-TRANSLATIONS-STRING "C:/" :LOCATION NIL)
source: (ERROR
(COMPATFMT
"~#<Uneven number of components in source to destination mapping: ~3i~_~S~#:>")
STRING)
I've added the same line to .clisprc and CLISP gave:
*** - LOAD: A file with name ITERATE does not exist
Update 2:
I've tried the setup above on Windows XP (i.e. by adding (push "C:\\Documents and Settings\\mayhem\\lisp\\iterate\\" asdf:*central-registry*) to CLISP init file and without using the junctioned/soft linked ASD files) and it did work! So the problem is limited to Windows 7. I've just learnt that the ASDF don't play well with the Windows soft links. Reference)

Run emacs lisp script

I found the script and i need run it.
I tried to run it like this (i used eval-buffer command):
(require 'subr-x)
(require 's)
(load-file "~/git-graph.el")
(require 'git-graph)
(git-graph/to-graphviz-pretty
"git"
(git-graph/git-graph-head
"E:/GitStack/repositories/gitRepo.git"
"master"))
But get an error:
Loading e:/emHome/git-graph.el (source)...done
let*: Symbol’s function definition is void: first
picture
Please tell me what is wrong. And how i can run this script?
I'm new to this.
Why are you loading library git-graph twice?
What happens if you just remove either the load-library line or the require line -- do you still get an error?
With your original code, insert this line after the load-library line:
(message "After load-library")
And insert this line after the require line:
(message "After require")
See which message(s) you get: check buffer *Messages*. That should tell you which attempt to load the library (if either) led to the error. Maybe look for the text first in the library, to see if you notice anything funny.
If it doesn't look like the problem comes from loading that library then it likely comes from the expression after your require.
Do M-x toggle-debug-on-error, then do your M-x eval-buffer, and post the *Backtrace* output here. That will show us just where the error is raised.
You can also try M-x debug-on-entry git-graph/to-graphviz-pretty and step through the debugger using d (or c to skip details of a given step). That will eventually show you which code raised the error.

Enabling org-latex in emacs24.5

I am complete beginner trying to set up emacs to work with latex in org mode to generate latex enabled pdfs.
I followed this link to add latex but i am getting following error on start of my emacs.
This happened after adding the code in the "1.2 Org-mode LaTeX export setup" in my init.el
Debugger entered--Lisp error: (file-error "Cannot open load file" "no such file or directory" "org-latex")
require(org-latex)
eval-buffer(#<buffer *load*> nil "/Users/prabhath/.emacs.d/init.el" nil t) ; Reading at buffer position 14780
load-with-code-conversion("/Users/prabhath/.emacs.d/init.el" "/Users/prabhath/.emacs.d/init.el" t t)
load("/Users/prabhath/.emacs.d/init" t t)
#[0 "\205\262 \306=\203\307\310Q\202; \311=\204\307\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB\321\202;\316\322\323\322\211#\210\322=\203a\324\325\326\307\327Q!\"\323\322\211#\210\322=\203`\210\203\243\330!\331\232\203\243\332!\211\333P\334!\203}\211\202\210\334!\203\207\202\210\314\262\203\241\335\"\203\237\336\337#\210\340\341!\210\266\f?\205\260\314\323\342\322\211#)\262\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
command-line()
normal-top-level()
Any suggestions are helpful.
I am using emacs 24.5, org mode > 8.
The link is outdated: there is no such thing as org-latex.el any longer. It is also the case that you do not need what that link describes at all.
To export an org file to latex (and thence to PDF), all you need to do is
C-c C-e l o
The LaTeX exporter is already loaded by default.

Emacs: open large files in external apps automatically

I would like to use Emacs as file manager too and open large file (in dired or speedbar) with xdg-open. Can I use defadvice for abort-if-file-too-large function and how to do it correctly?
Advising abort-if-file-too-large requires that it still raise an error even if it opens the file externally, otherwise find-file-noselect will still try to open the file. Also, you want to call the external program only when the operation type passed to abort-if-file-too-large indicates a file is being opened. Something like the following will work, though you might want to tweak the arguments to call-process to make it fit your scenario better:
(defun open-outside-emacs (orig-fun size op-type filename)
(if (not (string-equal op-type "open"))
(apply orig-fun size op-type filename)
(call-process "/usr/bin/xdg-open" nil 0 nil (expand-file-name filename))
(error "opened externally")))
(advice-add 'abort-if-file-too-large :around #'open-outside-emacs)

Modify mode-compile.el to handle MS-Windows paths with imbedded blanks?

Can anyone suggest a modification of mode-compile.el that will make it work better on Windows? My specific issue is handling of path names that contain blanks. I'm working on code in Ruby, using "GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600) of 2008-03-26 on RELEASE" with mode-compile.el version: 2.29 (Last modified: 2006/12/01 13:52:47)
The command line generated by mode-compile.el to compile (run) my buffer a.rb is this:
c:/ruby/bin\ruby.exe -w c:/Documents and Settings/William/My Documents/src/a.rb
Which generates this error:
c:/ruby/bin\ruby.exe: No such file or directory -- c:/Documents (LoadError)
This works just fine:
c:/ruby/bin\ruby.exe -w "c:/Documents and Settings/William/My Documents/src/a.rb"
As a work-around, I can just move my directory tree so that the path has no embedded blanks. Looking at the code in mode-compile.el, it APPEARS that a function exists already to add the quotes, however, as I am NOT proficient in emacs-lisp, perhaps this actually does something entirely different (like just appending a nearly-empty par of double quote marks):
(if to-compile-fname
(if mc--build-op-args
(mc--build-output-args to-compile-fname)
(concat " " to-compile-fname)
)
" "))))
mode-compile.el comes from here:
http://perso.tls.cena.fr/boubaker/distrib/mode-compile.el
Thanks in advance!
William
I don't have time to test this really, but it appears to me that the function mc--shell-compile needs to be updated. The filename of the buffer is extracted by the following lines:
(shfile (or mc--remote-pathname (buffer-file-name)
(error "Compilation abort: Buffer %s has no filename"
(buffer-name))))
the fix should be to quote the buffer-file-name:
(shfile (or mc--remote-pathname (shell-quote-argument buffer-file-name)
(error "Compilation abort: Buffer %s has no filename"
(buffer-name))))
Can you have a try and report, please?
Cheers,
Daniel

Resources