lokedhs / gnu-apl-mode Goto Github PK
View Code? Open in Web Editor NEWGNU APL mode for Emacs
License: GNU General Public License v3.0
GNU APL mode for Emacs
License: GNU General Public License v3.0
With emacs 26.1 on startup of gnu-apl I get the startup tips:
Could not find shared library 'libemacs'
The following directories and file names were tried:
file /usr/local/lib/apl/libemacs.so (No such file or directory)
file /usr/local/lib/apl/libemacs.dylib (No such file or directory)
file /usr/local/lib/apl/libemacs (No such file or directory)
directory /usr/lib/apl
file ./libemacs.so (No such file or directory)
file ./libemacs.dylib (No such file or directory)
file ./libemacs (No such file or directory)
file ./native/libemacs.so (No such file or directory)
file ./native/libemacs.dylib (No such file or directory)
file ./native/libemacs (No such file or directory)
directory ./emacs_mode
I can still execute APL in the window, but can't run any emacs keybindings for gnu-apl without "Symbol's value as variable is void: gnu-apl--connection," coming up in the minibuffer, and nothing happening.
I suspect I installed the shared modules wrong.
Hi, thanks for this great package for working with gnu-apl. I'm not sure if this is a bug or I do not understand the setup
I have a spanish keyboard (MAC OSX)
So I tried to map that two variables:
(setf gnu-apl-keymap-template
"╔════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦══════════╗
║ ª∇ ║ !∇ ║ \"∇ ║ ·∇ ║ $∇ ║ %∇ ║ &∇ ║ /∇ ║ (∇ ║ )∇ ║ =∇ ║ ?∇ ║ ¿∇ ║ ║
║ º∇ ║ 1∇ ║ 2∇ ║ 3∇ ║ 4∇ ║ 5∇ ║ 6∇ ║ 7∇ ║ 8∇ ║ 9∇ ║ 0∇ ║ '∇ ║ ¡∇ ║ BACKSP ║
╠════╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═══════╣
║ ║ Q∇ ║ W∇ ║ E∇ ║ R∇ ║ T∇ ║ Y∇ ║ U∇ ║ I∇ ║ O∇ ║ P∇ ║ ^∇ ║ *∇ ║ ║
║ TAB ║ q∇ ║ w∇ ║ e∇ ║ r∇ ║ t∇ ║ y∇ ║ u∇ ║ i∇ ║ o∇ ║ p∇ ║ `∇ ║ +∇ ║ R ║
╠═══════╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╗ E ║
║ (CAPS ║ A∇ ║ S∇ ║ D∇ ║ F∇ ║ G∇ ║ H∇ ║ J∇ ║ K∇ ║ L∇ ║ Ñ∇ ║ ¨∇ ║ Ç∇ ║ T ║
║ LOCK) ║ a∇ ║ s∇ ║ d∇ ║ f∇ ║ g∇ ║ h∇ ║ j∇ ║ k∇ ║ l∇ ║ ñ∇ ║ ´∇ ║ ç∇ ║ ║
╠═══════╦═╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩════╩═════╣
║ ║ >∇ ║ Z∇ ║ X∇ ║ C∇ ║ V∇ ║ B∇ ║ N∇ ║ M∇ ║ ;∇ ║ :∇ ║ _∇ ║ ║
║ SHIFT ║ <∇ ║ z∇ ║ x∇ ║ c∇ ║ v∇ ║ b∇ ║ n∇ ║ m∇ ║ ,∇ ║ .∇ ║ -∇ ║ SHIFT ║
╚═══════╩═════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩═══════════╝"
)
and
(setf gnu-apl--symbols
'(("diamond" "◊" "<")
("diaeresis" "¨" "1")
("i-beam" "⌶" "!")
("macron" "¯" "2")
("del-tilde" "⍫" "\"")
("less-than" "<" "3")
("del-stile" "⍒" "·")
("less-than-or-equal-to" "≤" "4")
("delta-stile" "⍋" "$")
("equals" "=" "5")
("circle-stile" "⌽" "%")
("greater-than-or-equal-to" "≥" "6")
("circle-backslash" "⍉" "&")
("greater-than" ">" "7")
("circled-minus" "⊖" "/")
("not-equal-to" "≠" "8")
("circle-star" "⍟" "(")
("logical-or" "∨" "9")
("down-caret-tilde" "⍱" ")")
("logical-and" "∧" "0")
("up-caret-tilde" "⍲" "=")
("multiplication-sign" "×" "'")
("exclamation-mark" "!" "?")
("division-sign" "÷" "¡")
("quad-divide" "⌹" "¿")
("question-mark" "?" "q")
("omega" "⍵" "w")
("omega-underbar" "⍹" "W")
("epsilon" "∊" "e")
("epsilon-underbar" "⍷" "E")
("rho" "⍴" "r")
("tilde" "∼" "t")
("tilde-diaeresis" "⍨" "T")
("uparrow" "↑" "y")
("yen-sign" "¥" "Y")
("downarrow" "↓" "u")
("iota" "⍳" "i")
("iota-underbar" "⍸" "I")
("circle" "○" "o")
("circle-diaeresis" "⍥" "O")
("star-operator" "⋆" "p")
("star-diaeresis" "⍣" "P")
("leftarrow" "←" "`")
("quote-quad" "⍞" "^")
("rightarrow" "→" "*")
("zilde" "⍬" "+")
("right-tack" "⊢" "ç")
("left-tack" "⊣" "Ç")
("alpha" "⍺" "a")
("alpha-underbar" "⍶" "A")
("left-ceiling" "⌈" "s")
("left-floor" "⌊" "d")
("underscore" "_" "f")
("del-tilde" "⍫" "F")
("nabla" "∇" "g")
("increment" "∆" "h")
("delta-underbar" "⍙" "H")
("ring-operator" "∘" "j")
("jot-diaeresis" "⍤" "J")
("apostrophe" "'" "k")
("quad-diamond" "⌺" "K")
("quad" "⎕" "l")
("squish-quad" "⌷" "L")
("down-tack-jot" "⍎" "ñ")
("identical-to" "≡" "Ñ")
("up-tack-jot" "⍕" "´")
("not-identical-to" "≢" "¨")
("subset-of" "⊂" "z")
("superset-of" "⊃" "x")
("greek-letter-chi" "χ" "X")
("intersection" "∩" "c")
("left-shoe-stile" "⍧" "C")
("union" "∪" "v")
("up-tack" "⊥" "b")
("pound-sign" "£" "B")
("down-tack" "⊤" "n")
("divides" "|" "m")
("shoe-jot" "⍝" ",")
("comma-bar" "⍪" ";")
("backslash-bar" "⍀" ":")
("slash-bar" "⌿" "-")
("quad-colon" "⍠" "_")
("pi" "π" )
("root" "√")
("inverted-exclamation-mark" "¡")
("quad-backslash" "⍂" )
("inverted-question-mark" "¿")))
That can be usefull for spanish keyboards too.
But when I tried to work with gnu-apl insert mode it doesn't work well for spanish only keys
Ñ,Ç<>, and ºª
I should change the gnua apl insert
it works well for other similar keys betwween spanish and english keyboads but for this different letters I do not get anything.
Also when I tap . the spanish suymbols do not appair,
I'm using this
GNU Emacs 28.0.50 (build 2, x86_64-apple-darwin19.3.0, NS appkit-1894.30 Version 10.15.3 (Build 19D76))
of 2020-02-17
I'm not sure where to continue. the reason seems to use quail UTF-8, maybe is this:
https://emacs.stackexchange.com/questions/38907/quail-rules-utf8-behaviour
For whatever reason there is an extra newline on input to the interpreter:
With this example
⎕ ← ⊂data ← (1 2 3 4) (2 5 8 6) (8 6 2 3) (8 7 6 1)
data
2 4⍴⍳8
calling gnu-apl-interactive-send-line
or gnu-apl-interactive-send-region
produces this:
╔═══════════════════════════════════════╗
║┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓║
║┃1 2 3 4┃ ┃2 5 8 6┃ ┃8 6 2 3┃ ┃8 7 6 1┃║
║┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛║
╚═══════════════════════════════════════╝
╔═══════╗
║1 2 3 4║
║5 6 7 8║
╚═══════╝
I believe the output should not have a tab character on the first line, like so:
╔═══════════════════════════════════════╗
║┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓║
║┃1 2 3 4┃ ┃2 5 8 6┃ ┃8 6 2 3┃ ┃8 7 6 1┃║
║┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛║
╚═══════════════════════════════════════╝
╔═══════╗
║1 2 3 4║
║5 6 7 8║
╚═══════╝
Originally posted by @doyougnu in #40 (comment)
See: #40 (comment)
M-x gnu-apl
C-h v default-input-method
default-input-method is a variable defined in ‘mule-cmds.el’.
Its value is "german-postfix"
Original value was nilDefault input method for multilingual text (a string).
This is the input method activated automatically by the command
‘toggle-input-method’ (C-).You can customize this variable.
Probably introduced at or before Emacs version 21.1.[back]
M-x cu-var default-input-method
Hide Default Input Method: Choice: Value Menu String: german-postfix
State : CHANGED outside Customize.
Default input method for multilingual text (a string). Hide
This is the input method activated automatically by the command
‘toggle-input-method’ (C-).
Groups: Mule
See also Manual.
Shouldn’t we expect "apl-z"? I’m not setting default-input-method
anywhere in my startup files. Perhaps what is said in chapter 23.2 of the Emacs manual applies. I’m running Emacs on Ubuntu 22.04.
GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-10-26
gnu-apl-mode-20220404.341
Any help is much appreciated!
Hangs when trying to )load
a workspace saved via )save
. Works in raw GNU APL, and for scripts saved via )dump
.
Following head, libemacs.so
rebuilt after update, GNU APL r251, Emacs 24.3.50, Kubuntu 12.04 LTS.
From .emacs-custom:
'(gnu-apl-flash-on-send t)
'(gnu-apl-show-apl-welcome t)
'(gnu-apl-show-keymap-on-startup t)
Config:
GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-10-26
gnu-apl-mode-20220404.341
Thanks!
Is where a possibility to add other backend, for example Dyalog APL?
Would you add this package to MELPA? Also, what is the license?
Changing cl-defun
to defun*
in gnu-apl-util.el
seems to fix this. Probably worth investigating.
Right now M-.
allows to jump/edit the function which is defined in some source file.
However if the function just has been created in the interpreter session it is impossible to edit it using M-.
from the interpreter session.
One can type C-c C-f
and type a function name to edit it.
It could be great to point to the function and type M-.
as well in the interpreter session to edit functions instead of manually type their name with C-c C-f
.
Hello,
I recently downloaded gnu-apl-mode to emacs. When I try to do s-l a Cinnamon Debugger screen pops up, when I do s-e I get my file manager.
It would be nice if you included a way to change the APL key.
Thanks
In an attempt to disable smartparens in GNUAPL
(defun smartparens-off ()
(interactive)
(smartparens-mode 0))
(add-hook 'gnu-apl-mode-hook 'smartparens-off)
But still it is enabled! I can turn it off by evaluating it outside of a hook (smartparens-off).
Also try (add-hook 'gnu-apl-mode-hook 'fundamental-mode)
and watch it not work on GNU Emacs 27.0.50
First of all, thanks for creating this. I'm new to APL and this is so much better then typing in unicode hex codes into urxvt... :)
I use a tiling window manager and Super is dedicated to it. That fact is stored more deeply in my muscle memory than most generic human motor skills. I switched gnu-apl-mode
to employ the unused Hyper key but this required editing the code and recompiling and will get clobbered next time you push an update to MELPA.
Would you please make the hotkey configurable via a customization option?
By binding C-c f
, C-c k
, C-c s
, and C-c v
, the keybinding conventions are ignored.
Cf. M-: (info "(elisp) Key Binding Conventions") RET
:
* Don't define `C-c LETTER' as a key in Lisp programs. Sequences
consisting of `C-c' and a letter (either upper or lower case) are
reserved for users; they are the *only* sequences reserved for
users, so do not block them.
Please consider using different keybindings.
Also, thanks for your work, and keep it up! GNU APL without a nice Emacs mode would be much less fun.
I got a following string every time I run gnu-apl with SVN version (r662) of GNU APL on OSX. What could it mean? Any way to get rid of it?
I get the following error message trying to run gnu-apl-mode
:
Wrong type argument: integer-or-marker-p, (concat prefix s)
eval-buffer: Symbol's function definition is void: cl-defmacro
More a question than an issue : is there currently a way to open multiple APL sessions in the same emacs instance ?
Background : I'd like to implement an ob-gnu-apl
package , ideally using gnu-apl-mode
, which is excellent, and supporting multiple sessions (useful for, e. g., pedagogical reasons).
Advice ?
Non-fatal warning in the *Messages*
buffer.
hi Elias, hi APL-folks,
first let me thank for this sexy piece of software! I am new to the
APL-world, but really enjoy wraping my mind around these wonderful
symbols! :)
I am running current gnu-apl (svn1242) with current gnu-apl-mode
(20200108.1633) under current GNU/Linux Emacs (from git) and MacOSX
Emacs (26.3 from brew). Tried also with emacs -Q, having only
loaded gnu-apl-mode. Both versions/platform show the same error:
Working out of the plain terminal with gnu-apl, editing functions in
line-editing, multiple redefining functions, etc - works fine.
Thanks for any help or hint!
br okflo
When editing interactive function, it is not possible to close/save function buffer with Ctrl-c Ctrl-c when the function contains build-in function calls like
)HOST 'ls'
The error is
Error on line 41: Error parsing expression
In Emacs 24.3.50, following head (SHA: 6b49f2d at the time of writing, but probably introduced quite a bit earlier), after invoking gnu-apl
:
Debugger entered--Lisp error: (void-function parse-integer)
(parse-integer addr)
(open-network-stream "*gnu-apl-connection*" nil "localhost" (parse-integer addr) :type (quote plain) :return-list nil :end-of-command "\n")
(cond ((string= connect-mode "tcp") (open-network-stream "*gnu-apl-connection*" nil "localhost" (parse-integer addr) :type (quote plain) :return-list nil :end-of-command "\n")) (t (error "Unexpected connect mode: %s" connect-mode)))
gnu-apl--connect-to-remote("tcp" "7293")
[…]
Fix:
Use string-to-number
:
diff --git a/gnu-apl-network.el b/gnu-apl-network.el
index a20bb64..f366232 100644
--- a/gnu-apl-network.el
+++ b/gnu-apl-network.el
@@ -4,7 +4,7 @@
(defun gnu-apl--connect-to-remote (connect-mode addr)
(cond ((string= connect-mode "tcp")
- (open-network-stream "*gnu-apl-connection*" nil "localhost" (parse-integer addr)
+ (open-network-stream "*gnu-apl-connection*" nil "localhost" (string-to-number addr)
:type 'plain
:return-list nil
:end-of-command "\n"))
Dear Elias,
The APL-Z input method is exceedingly useful to APL users whose keyboard des not have (and cannot have) a Super
key (case in point : my laptop ;-)). But it is currently wed to gnu-apl-mode
, hence the Gnu APL interpreter.
I just tested that, in a fresh emacs session, (load "~/.emacs.d/elpa/gnu-apl-mode-20220404.341/gnu-apl-input.el")
is enough to be able to successfully start the APL-Z
input mode in a fresh emacs-jupyter REPL running a Dyalog APL kernel.
This suggests that gnu-apl-input.el
(with its companion file gnu-apl-symbols.el
and possibly the relevant part of gnu-apl-documentation
providing gnu-apl-show-keyboard
) could be split off in a package (say, gnu-apl-input-mode
) that gnu-apl-mode
could require, but that could be used by the users of ofther interpreters. (Case in point : emacs-jupyter
allows org-mode
users to instert "live" source blocks ; which was my point actually...).
What do you think ?
I'm in the gnu-apl-mode interactive buffer. Typing anything and pressing RET displays "Current buffer has no process".
What does it mean and how do i fix it?
GNU APL Mode adds a keybinding for C-c r
:
Line 230 in 2118e0e
This is contrary to Emacs conventions:
Don’t define C-c letter as a key in Lisp programs. Sequences consisting of C-c and a letter (either upper or lower case) are reserved for users; they are the only sequences reserved for users, so do not block them.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.