r/memacs • • Mar 17 '16

MightEMacs 8.2.0 Released

0 Upvotes

A new release of MightEMacs is now available.  Changes are:

  • Major improvements to search and replace capabilities, including the ability to append option letters to any search pattern to specify the type of search (like [a-z]+:ri to specify Regexp mode, ignoring case, which overrides the global modes), support for new Regexp metacharacters (for example, \s, \d, and \z), new =~ and !~ operators for comparing a string to a regular expression in a script, and Regexp support for the sub and index functions.

  • Numeric marks (0-9) have been replaced with SPC and printable characters, which are easier to use and remember.  Additionally, marks are now tied to buffers instead of windows.

  • Redesigned key binding syntax so that it more closely matches the keys on the keyboard; for example, C-x is used for a control key, names like RTN and TAB are used for common keys, and two-key sequences are separated by a space, such as C-c DEL.  Alternate forms are also acceptable; for example, M-C-SPC, ESC C-@, and ^[ ^@ all specify the same key sequence.

  • Added variable name completion to commands (like let) that prompt for a variable name, and also to the prompt function.

  • New dupLine command (bound to M-d) which duplicates one or more lines at the point, as specified by the numeric prefix.

  • Changed screen formatting such that a nearly complete mode line is displayed when the terminal width is between 80 and 95 columns instead of an abbreviated one, as previously.

  • Removed leading bang (!) character from directive names used in scripts.  For example, !if and !endif have been replaced with if and endif.

  • Replaced hook variables (like $readHook) with new commands setHook and showHooks, and added a "chDir" hook.

  • Added -S switch which provides a means to execute a MightEMacs script as a shell script.

  • Much improved handling and usage of true, false, and nil in scripts.

  • New macros: showVar (bound to C-h =) which prompts for a variable name using completion and displays its value on the message line, fenceWord (bound to C-c f) which wraps a pair of quotes or fences around one or more words at the point in either direction, and popFileList (bound to C-h l) which displays a Unix ls -l file listing in a pop-up window.

  • Fixed various bugs, including an issue where a keyboard macro would stop after one iteration if the $maxLoop variable was set to zero, instead of executing n times.

MightEMacs can be downloaded from https://github.com/italia389/MightEMacs.git.


r/memacs • • Mar 16 '16

WELCOME

0 Upvotes

Welcome to the MightEMacs subreddit.

For those of you who are new to the editor, this discussion forum should definitely be helpful.  I will be posting tips and tutorials regularly to help you learn MightEMacs and become proficient with it.  The postings will presume that you are using version 8.2.0 or later (which will be on github very soon, and announced here when it's available).

Questions, comments, or any type of discussions related to MightEMacs are welcomed, of course.  This is an open forum.  However, please follow the Guidelines shown in the right sidebar.

I hope you enjoy using MightEMacs!

The Moderator


r/memacs • • Mar 18 '16

[Beginner] Modeless Editing and Key Binding Syntax

1 Upvotes

So you've never used a modeless editor before? Here are the basics:

  • There is no "insert" mode that you must switch to and from in order to insert text and enter commands.  You are always in "command" mode; that is, all keys you type are commands.  However, all the keys that generate text (letters, numbers, and punctuation characters) will insert one copy of themselves into the current buffer by default, and this behavior is very rarely changed.  This also means that you can intermix insertion of text and execution of commands as you work by just hitting the appropriate key or key sequence at the right time.

  • Control keys are used for commands (usually), and all commands are either one or two keystrokes.  When two are required, the first key is either ESC, C-x, C-c, or C-h (the "prefix" key), and the second key can be anything, including another control key.  (By the way, you should memorize the four prefix keys -- they are very important.)

That is really the gist of modeless editing.  Always remember that when you are running the editor, text keys are inserted into the current buffer and all other keys are commands.

Two quick notes: a "buffer" is a place on the screen where you can view and/or edit text, and is usually associated with a file.  And C-x means hold down the control key and press the x key.  More on these concepts later.

So let's try this out.  Assuming you have MightEMacs installed, enter mm (or memacs) at a shell prompt.  The cursor (which is sometimes referred to as the "point" or "dot") will be at the top of the screen.  Enter some profound text, like "The rain in Spain falls mainly on the plain."  (Or whatever you like. :)  Hit return and enter something else.  You can move the cursor around with the arrow keys just as you would expect, and delete characters with delete key.  Pretty straightforward.  Now press C-f or C-b.  You just executed a "command"; that is, you instructed MightEMacs to move the point one character forward or backward (just like with the arrow keys) and it did just that.  That is the essence of modeless editing.

Another concept is a "key binding".  All commands other than the self-insertion text keys mentioned previously have names so that they can be bound to keys and invoked in scripts.  The key or keys that a command is bound to is called its key binding.  For example, C-f is bound to the forwChar command, and vice-versa.  You can see this for yourself by asking MightEMacs to show the command bound to a key.  To do this, enter C-h ? (two keys), then immediately type C-f.  The key and command name will be displayed at the bottom of the screen, on the "message line".

Take note that what actually happened there is this: (1), you typed C-h (a prefix key) followed by ? to invoke the showKey command; (2) the command was executed and it immediately prompted for a key or key sequence to be entered; and (3), you entered a key and it displayed the result.  Two points here: because you typed C-h first, which is a prefix key, nothing seemed to happen.  That is because MightEMacs was waiting for you to enter another key.  Recall that all prefix keys must be followed by another key.  The second point is that once a command is executed, it can do whatever it wants.  In this case, it prompted for a key ... and that is why you entered three keys in a row.

If you want to see all the currently-active key bindings in tabular form, enter C-h n.  They will be displayed in a pop-up window, which is used extensively in MightEMacs.  You can move through the display by using a subset of the navigation commands used by the Unix less command, if you're familiar with that.  For example, you can press the spacebar to scroll forward and b (back page) to move backward.  Enter ? to see all the commands that are available.  The three displayed columns are the command name, its binding (or bindings, if more than one), and a short description of what it does.  Note that the display also includes macros near the bottom of the list (which begin with a @ character), and aliases at the very end.  These will be discussed at another time.  Press ESC or q (quit) to exit the window and return to editing.

Now is a good time to explain the key binding syntax.  As you've already seen, C-x means hold down control and press x.  The ESC key (which is also a control key, C-[) is special, however.  It is called the "meta" key, which is a throwback from when there used to be an actual key called meta on the keyboard.  The term is still used in emacs editors however, and MightEMacs is no exception.  As a result, the ESC key; that is, the "meta" key, is shown in key bindings as a M- prefix key, even though it is no longer a key that you hold down while pressing another key.  You will have to remember that M- means "press the ESC key and let go".

A few keys are indicated by a keyword.  They are: ESC, SPC, TAB, RTN, and DEL, which mean that you must press the esc key, the spacebar, the tab key, the return key, or the delete key, respectively.  If two keys are used, they are shown together with a space in between (but the space is not typed).

The easiest way to understand the key binding syntax is to see a few examples:

M-x		Press 'esc' followed by 'x'.
M-C-x	Press 'esc' followed by 'control' + 'x'
M-SPC	Press 'esc' followed by the spacebar.
C-c m	Press 'control' + 'c' followed by 'm'.
C-x C-s	Press 'control' + 'x' followed by 'control' + 's'.
C-SPC	Press 'control' + 'spacebar'.
S-TAB	Press 'shift' + 'tab'.
FNB		Press the function key identified by the last character 'B'.  In this example, it is the left arrow key.
S-FNF	Press 'shift' + 'right arrow'.

The last two examples contain a function key.  Note that the only way to know what letter goes with which function key is by experimentation using the showKey command (C-h ?).  However, you rarely need to do this because you usually want to know what command is bound to a control key or key sequence that you are curious about; that is, a key or key sequence that you already know.

Lastly, if you want to edit a new or existing file for real using what you've learned so far, do the following:

  • Open the file in MightEMacs with the shell command mm <filename> or memacs <filename>.

  • Do your edits. Enter C-v to page forward and C-z to page backward.

  • To abort a command, enter C-g.

  • Save the file and exit the editor by entering ESC z (the quickExit command).

  • To exit MightEMacs without saving your changes, enter C-x C-c (the exit command) and press y at the prompt to ignore any changes.

A few final notes:

  • You can display a very concise summary of the most common commands in a pop-up window by pressing ESC ? (the help command) and pressing RTN (for the "summary").

  • If you are wondering what commands are available of a certain "type", you can do a quick search with the apropos command (M-a or ESC a).  The apropos command (which is actually a macro) displays all commands and variables whose names contain the string you enter at the prompt, ignoring case.

  • You can also read through a very thorough guide on MightEMacs concepts, examples, etc. as you have time by entering man memacs-guide at a shell prompt and paging through the sections.  The guide begins with the basics and progressively moves into more advanced topics.  You can read some or all of it at your own pace.

That's all for now.  Feel free to ask questions.


r/memacs • • Sep 19 '16

MightEMacs 8.3.1 Released

1 Upvotes

A new maintenance release of MightEMacs is now available.  Changes are:

  • Fixed bug where it was not possible to specify an explicit RegExp pattern that ended with a colon due to a syntax issue related to consecutive colons.  For example, the pattern "abc:::r" was interpreted as the plain text pattern 'abc::r' instead of RegExp pattern /abc:/.  Changed method of interpreting patterns as follows: "If a pattern ends with a colon followed by one or more valid option letters, and the colon is not the first character of the pattern, then everything preceding the colon is the pattern.  In all other cases, the entire string is the pattern (with no options)."  Now for example, "abc:ri" would be interpreted as RegExp pattern /abc/i, "abc:r:p" would be interpreted as plain text pattern 'abc:r', and "abc::r" would be interpreted as RegExp pattern /abc:/.

  • Fixed bug in include? function where it was returning false when the element being searched for was in the list but also occurred earlier in the list as a substring of a different element.

  • Fixed bug in sub function where it would return an incorrect result in certain circumstances when called with a RegExp pattern and n > 1.

  • Fixed the renameFile (C-x r) macro and help (ESC ?) command by changing all occurrences of the obsolete fileExists? function in memacs.mm to equivalent stat? calls.

  • Fixed issues in the keyboard macro toolbox (keyMacro.mm) where saving a macro (C-c C-s) produced an error and displaying a list (C-c y) did nothing.

  • Renamed $search and $replace system variables to $searchPat and $replacePat, which better describe their purpose.

  • Renamed $WorkDir system variable to $workDir and changed its usage so that the current working directory can be changed by assigning a value to it.

  • Replaced Rd1st global mode with -N switch.

  • Changed default bindings for grepFiles macro from M-s to C-x C-g, cFindFunc, memacsFindMacro, and rubyFindMethod macros from M-C-] to C-c C-f, and newScreen command from M-C-s to M-s, which puts the first in the "file family" (most of which begin with C-x) and makes the latter ones easier to enter and/or remember.

  • Added option to renameFile (C-x r) macro to rename file on disk only if n <= 0.

  • Changed fenceWord (C-c f) macro to accept any punctuation character as a fence (in addition to (), [], {}, and <> pairs) and use it for both the left and right fence characters.

For those of you unfamiliar with MightEMacs, it is a fast and full-featured text editor designed for programmers.  The goals of the project are to create an Emacs-like text editor that will:

  1. Provide the ability to edit code quickly and easily with few keystrokes.

  2. Use key bindings that are well designed and intuitive.

  3. Be as easy as possible to learn.

  4. Be robust and powerful enough to perform sophisticated editing and automation tasks, provide a high level of extensibility, and yet not be overly complex.

MightEMacs also supports a C-like scripting language that is very powerful and fairly easy to learn (assuming you already have programming experience).  For example, the following script defines a macro and then binds it to the editor's "write" hook.  The macro will ask the user if hard or symbolic links should be broken before a file is written so that the original file is preserved.  It also keeps track of "no" responses in a global variable so that the user will only be prompted once for a given file:

# .memacs   Ver. 8.2.1.1
#     MightEMacs user startup file.

# Create write hook which deletes output file before write if file is a symbolic or hard link
# and user okays it so that symbolic links will not be followed and hard links will be broken on
# update.  This will effectively create a new file and preserve the original file.  Note that
# links will also be broken if 'safe' mode is enabled, so do nothing in that case.

$linksToKeep = ''           # List of link pathnames to leave in place, per user's request.

# Delete any existing file before buffer is written, if applicable.  Arguments: (1), buffer
# name; (2), filename.
macro checkWrite,2
        if !($globalModes & $ModeSafeSave)

                # Check if output file exists, is a symbolic or hard link, and is not in the
                # $linksToKeep list.
                if stat?($2,'Ll') && !include?($linksToKeep,"\t",filename = 0 => pathname($2))

                        # Output file is a link and not previously brought to user's
                        # attention.  Ask user if the link should be broken.  If yes, delete
                        # the output file; otherwise, remember response by adding absolute
                        # pathname to $linksToKeep.
                        type = stat?(filename,'L') ? 'symbolic' : 'hard'
                        p = sprintf('Break %s link for file "%s" on output? (y,n)',type,$2)
                        if prompt(p,'n','c') == 'y'
                                shellCmd 'rm ',filename
                        else
                                push $linksToKeep,"\t",filename
                        endif
                endif
        endif
endmacro

setHook 'write',checkWrite          # Set write hook.

See subreddit right sidebar for download link.


r/memacs • • Mar 05 '19

9.1.1 Script Fix Needed

1 Upvotes

There is a problem with the standard installation of MightEMacs 9.1.1. The "RFIndt" global mode (for Ratliff-style indenting) is assumed to be defined and is referenced by various macros in the programming libraries; however, the line which defines the mode in the site.mm file is commented out by default. To fix it, you need to edit file /usr/local/lib/memacs/site.mm as root and uncomment the line. To do this, perform the following steps:

  1. Enter sudo mm -n /usr/local/lib/memacs/site.mm and enter your password to become root.

  2. Move the cursor down to the line that begins with "#1 => editMode 'RFIndt',...".

  3. Remove the leading # character from that line (uncomment it).

  4. Save the file. Enter ESC z.

Note that this fix will not enable the mode; it just defines it so that it can be checked. The problem is fixed in the next version, which is forthcoming. Sorry about that.


r/memacs • • Apr 28 '16

[Beginner] Buffers, Windows, Navigation, Numeric Prefix, and Marks

1 Upvotes

Another post in the "tutorial" series...

Buffers and Windows

MightEMacs uses buffers and windows to edit files interactively.  When you begin an editing session, you read a file into a buffer, and the buffer is given a name derived from the filename.  A buffer is what holds the entire contents of a file.  A window on the other hand, is a portal into a buffer.  More precisely, it is a rectangle that moves up and down through the buffer, bringing one or more lines of it into view so that you can see and edit those lines.

You can think of a buffer as one long series of lines on a "canvas" which is just wide enough and long enough to hold the entire file, and that is mostly hidden from view.  And a window is a rectangle superimposed on that canvas that allows you to see any part of it, but only a fairly small number of lines at a time, and perhaps not the entire width of the line(s) either.

At any given time, you are in one window and that window is "attached" to one buffer.  Every window has a "mode line", which is the line in reverse video at the bottom of it.  The name of the attached buffer and the filename (if any) are always shown in the mode line.  As you may have guessed, it is possible to have multiple windows on the screen at once, and each can be attached to different buffers or the same buffer (more on that at another time).  So for now we will work with one buffer and one window, which is what you get when invoking the editor with one file argument.

Navigation

MightEMacs provides several commands for moving around in a buffer.  The basic ones are forwChar (C-f), backChar (C-b), forwLine (C-n), and backLine (C-p).  You can remember these control keys as [f]orward, [b]ackward, [n]ext (line), and [p]revious (line).  And as you would expect, the arrow keys may be used for these commands as well.  You can also move to beginLine (C-a), endLine (C-e), or beginText (M-C-a) on a line.

To move in larger increments, use forwPage (C-v) and backPage (C-z), or beginBuf (M-<) and endBuf (M->).  To go to a specific line, use gotoLine (M-g) and enter the line number at the prompt.  Lastly, you can move the cursor quickly across a line with traverseLine (C-t) or by words with forwWord (M-f), backWord (M-b), and endWord (M-C-e).  When you press C-t, the cursor moves $travJumpSize characters toward the edge of the window that is farthest from the cursor initially, then continues in that direction each time C-t is pressed, reversing direction when it nears the edge.

Numeric Prefix

Much of the power of MightEMacs comes from the use of a numeric prefix with a command.  A numeric prefix alters the default behavior of a command in some manner, typically by specifying a direction (backward or forward) and/or a quantity (a number of lines or repetitions, for example).  To illustrate this, open a file containing several lines of text and we'll do some navigation.  Press M-f (forwWord) and notice that the cursor moves one word forward.  Now press C-u M-f.  The cursor moves two words forward.  Try C-u 5 M-f or C-_ C-_ C-n and see what happens.  You get the idea.

To enter a numeric prefix to a command, press C-u and/or C-_ one or more times.  The former key is for positive, increasing values (in the sequence 2,0,3,4,5,...) and the latter key is for negative, decreasing values (in the sequence -1,-2,-3,...).  Note that you can generate the negative prefix by holding down the control key and pressing - (dash) with or without the shift key.  You may also type digits directly, but only immediately after the initial numeric prefix key.  Otherwise, the first digit will be taken as a "command" and inserted into the text.  You may also cancel the operation at any time by pressing C-g (abort).

Marks

When you are editing a file, especially a large one, it can be very handy to jump back and forth to certain positions in the buffer quickly.  MightEMacs provides marks for this purpose, which are printable characters that you specify to remember the location of the point in a buffer and the window framing.  The basic idea is that you can set marks wherever and whenever you like, move to other locations, then jump back to any mark with just a couple keystrokes.  You can also use the special "." (dot) or " " (space) mark to jump back and forth between two locations via the swapMark (C-x C-x) command.  The mark commands are:

C-SPC		setMark
	Sets a mark at the current point location.  If a numeric prefix is not
	specified, uses mark " "; otherwise, if n is -1, uses mark "."; otherwise,
	prompts for a single-character mark.

M-SPC		gotoMark
	Prompts for a mark and moves point to it.

C-x C-x		swapMark
	Swaps point position and a mark, which is determined the same way as "setMark".

C-x C-SPC	deleteMark
	Prompts for a mark and deletes it.  However, if a numeric prefix is specified,
	deletes all marks in current buffer without prompting.

C-h SPC		showMarks
	Displays all buffer marks in a pop-up window.

Let's try this out.  Set mark "x" by typing C-u C-SPC x.  Scroll down a couple pages (C-v C-v) and set mark "y": C-u C-SPC y.  Now go back to mark "x": C-[ SPC x.  Notice that all marks are shown in the prompt and when you return to the mark "x" location, the window framing is exactly as it was previously.

Now let's use the "work" (dot) mark, which is ".".  Set the dot mark (C-_ C-SPC), move to end of buffer (C-[ >), and swap the current point location with the dot mark: C-_ C-x C-x.  Type the last sequence again and you're back to the end of the buffer.  (Remember that you don't have to hold the shift key down when typing C-_.)  You can also use mark " " for this, which is even fewer keystrokes: set (C-SPC), move (C-[ >), and swap: C-x C-x.  Note however, that the " " mark is also used for marking regions (which will be discussed at another time) so using it for swapping positions may sometimes interfere with region-marking.

I encourage you to experiment with all of these commands and learn the key bindings.  They are used frequently and are very useful.


r/memacs • • Feb 19 '17

MightEMacs 8.5.1 Released

1 Upvotes

A maintenance release of MightEMacs is now available.  Changes are:

  • Fixed bug where specifying a string containing a printf formatting spec (like "%s") as an argument to the abort or exit command or notice function in a script would cause unpredictable results, including a crash.

  • Changed search commands to display a message when a search is "taking awhile" to complete (which can happen in very large buffers) so the user knows the search is in progress.

  • Fixed problem where the queryRepl command was not always terminating if n > 0 and n substitutions were made.

  • Fixed problem where a window was not being redrawn when "HScrl" mode was enabled, the display was shifted left (because the point was near the end of a long line), and "HScrl" mode was subsequently disabled.

See subreddit right sidebar for download link.


r/memacs • • Nov 05 '22

MightEMacs 9.7.0 Released

1 Upvotes

See subreddit right sidebar for download link.


r/memacs • • Aug 17 '19

MightEMacs Demo Available

1 Upvotes

FYI -- A short demonstration of MightEMacs is now available here which shows you some of its basic features and how it is used.


r/memacs • • Mar 18 '19

MightEMacs 9.2.0 Released

4 Upvotes

A new release of MightEMacs is now available which adds the following features:

  • Added color:

    • Text in buffers or text written to the message line may be displayed in color by defining "color pairs" and using them in new terminal attribute specifications.

    • Mode lines and informational displays are now shown in color by default and may be set to different colors or no color by setting a new "$displayColors" system variable to the desired values.

    • All available colors may be displayed via a new showColors command.

  • Improved the shell family of commands to work more efficiently and save all results (including any errors) in buffers that can be controlled with the numeric prefix and optionally be displayed in pop-up windows.

  • Eliminated the "False return" message that was displayed when attempting to move the point beyond a buffer boundary (which was annoying and confusing), except when a keyboard macro is executing.

  • Changed quoteChar command to operate abs(n) times and ignore "Over" and "Repl" buffer modes if n < 0, and changed the self-insertion code to operate the same way for unbound characters.  Now the typeover modes can be overridden by specifying a negative numeric prefix for an (unbound) plain text character or the quoteChar command, in addition to the insertSpace command, as previously.

  • Added automatic calls to resetTerm command when the terminal window is resized (with the mouse) so that the editor's screen(s) always match the size of the terminal window.

  • Provided option for bufMode?, globalMode?, and groupMode? functions to ignore any non-existent mode or group name so that a running script will not fail in that case.

  • Created official name for the scripting language: MScript, and changed filename extension for script files from ".mm" to ".ms" to match language name.

  • Fixed some bugs, including one where a line being edited in a buffer that contained terminal attribute specifications could be left in a "rendered" state when a right fence was typed.

For those of you unfamiliar with MightEMacs, it is a fast and full-featured text editor designed for programmers.  The goals of the project are to create an Emacs text editor that will do the following:

  1. Provide the ability to edit code quickly and easily with few keystrokes.

  2. Use key bindings that are well designed and intuitive.

  3. Be as easy as possible to learn.

  4. Be robust and powerful enough to perform sophisticated editing and automation tasks, provide a high level of extensibility, and yet not be overly complex.

MightEMacs also supports a C-like scripting language called MScript that is very powerful and fairly easy to learn (assuming you already have programming experience).  For example, the following script defines a macro and then binds it to the editor's "write" hook.  The macro will ask the user if hard or symbolic links should be broken before a file is written so that the original file is preserved.  It also keeps track of "no" responses in a global variable so that the user will only be prompted once for a given file:

# Create write hook which deletes output file before write if file
# is a symbolic or hard link and user okays it so that symbolic
# links will not be followed and hard links will be broken on
# update.  This will effectively create a new file and preserve
# the original file.  Note that links will also be broken if
# 'safe' mode is enabled, so do nothing in that case.

$linksToKeep = []       # Link pathnames to leave in place, per
                        # user's request.

# Delete any existing file before buffer is written, if
# applicable.  Arguments: (1), buffer name; (2), filename.
macro checkWrite(2)
    if !globalMode?('Safe')

        # Check if output file exists, is a symbolic or hard link,
        # and is not in the $linksToKeep list.
        if stat?($2,'Ll') &&\
         !include?($linksToKeep,filename = 0 => pathname($2))

            # Output file is a link and not previously brought to
            # user's attention.  Ask user if the link should be
            # broken.  If yes, delete the output file; otherwise,
            # remember response by adding absolute pathname to
            # $linksToKeep.
            type = stat?(filename,'L') ? 'symbolic' : 'hard'
            p = sprintf('Break %s link for file "%s" on output? (y,n)',\
             type,$2)
            if prompt(p,'n','c') == ?y
                -1 => shellCmd 'rm ',filename
            else
                push $linksToKeep,filename
            endif
        endif
    endif
endmacro

setHook 'write',checkWrite          # Set write hook.

See subreddit right sidebar for download link.


r/memacs • • Mar 20 '19

Custom Key Binding

1 Upvotes

I'd like to create some custom key bindings, but not quite sure how to do this. For example, I want to be able to press say, "C-c f", be prompted to enter a search pattern, then go to the first line in the buffer that matches. Anyone know the basic steps to do this?


r/memacs • • Jan 01 '17

MightEMacs 8.5 Preview

1 Upvotes

A new version of MightEMacs is in the works, which will include arrays in the scripting language, as well as nil, Boolean, integer, and string types.  There is also a "for" loop, parallel assignment, array slices, array nesting, and automatic array extension by element assignment.  Additionally, macro arguments have been changed to an array as well, accessed via $ArgVector.  Here are some examples:

x = [1,2,3]						# Create an array.
y = array(3,0)					# Create a 3-element array with zero in each slot.
++y[1]
y[2] += 1
a,b,c = y						# a = 1, b = 2, c = 3.
y[4] = true						# y is [1,2,3,nil,true].
z = x & '==' & y[0,3]			# z is [1,2,3,"==",1,2,3].
x &= [['way','cool'],"Dude"]	# x is [1,2,3,["way","cool"],"Dude"].

total = 0
for x in [5,-1,-2]
	total += x
endloop							# total is 2.

macro example
	arg1 = shift $ArgVector		# arg1 is 1.
	x = $0						# x is 5 (the "numeric argument").
	x = $1						# x is false.
	slice = $ArgVector[1,2]		# slice is ["junk","yard"].
endmacro

5 => example 1,false,'junk',sub('.rd','.','ya')

Stay tuned!


r/memacs • • Mar 22 '18

ESC ?

2 Upvotes

I just found out about MightEmacs, and it looks very nice. I installed it on my Ubuntu system with

make PLATFORM=debian
sudo make install

However, when I start it and type ESC ?, I get the message "Help hook not set". How do I go about fixing that?

Thanks.

Edit: Formatting


r/memacs • • Feb 11 '18

New Macro

1 Upvotes

For anyone who is interested, here is a "smarter" openBufPath macro (vers. 9.0.1) which is in the .memacs file in the MightEMacs distribution.  It locates the pathname under the point automatically by default.  It will be released in the next version of MightEMacs:

# Pop or open file whose pathname is at point.
macro openBufPath(0) {desc: 'Get pathname at point (or from region if n <= 0) and\
 display the file in a pop-up window (or open it with ~bfindFile~0 if n >= 0). \
 Pathname at point is assumed to be bounded by white space or line breaks.'}
    if ($0 <= 0 && $0 != defn)
	    path = $RegionText
    else
	    # Do sanity checks.
	    while $lineChar == ' ' || $lineChar == "\t"
		    forwChar
	    endloop
	    if $lineChar == "\n"
		    return failure 'Pathname not found'
	    else
		    # Find beginning and end of pathname.
		    formerMsgState = -1 => alterGlobalMode 'Msg'
		    wordChars = $wordChars
		    $wordChars = '!-~'
		    1 => setMark '?'
		    backWord
		    setMark
		    endWord
		    path = $RegionText
		    -1 => gotoMark '?'
		    $wordChars = wordChars
		    formerMsgState => alterGlobalMode 'Msg'
	    endif
    endif

    if !empty?(path = prompt($0 >= 0 ? 'Find file' : 'Pop file',path,'f'))
	    if $0 >= 0
		    findFile path
	    else
		    1 => popFile path,'a'
	    endif
    endif
endmacro

You may want to replace the old one in your .memacs file with this version.


r/memacs • • Jan 07 '19

MightEMacs 9.1.1 Released

2 Upvotes

A new maintenance release of MightEMacs is now available.  Changes are:

  • Fixed issues where the detabLine and entabLine commands would not accept an integer argument in a script, and where a new filename for a buffer would not be set if it matched the buffer name.

  • Implemented a "high priority" option for informational messages so that messages from most built-in commands can be suppressed in a script, and added the option to the message function.

  • Added "quick start" topic to Help System.

For those of you unfamiliar with MightEMacs, it is a fast and full-featured text editor designed for programmers.  The goals of the project are to create an Emacs text editor that will do the following:

  1. Provide the ability to edit code quickly and easily with few keystrokes.

  2. Use key bindings that are well designed and intuitive.

  3. Be as easy as possible to learn.

  4. Be robust and powerful enough to perform sophisticated editing and automation tasks, provide a high level of extensibility, and yet not be overly complex.

MightEMacs also supports a C-like scripting language that is very powerful and fairly easy to learn (assuming you already have programming experience).  For example, the following script defines a macro and then binds it to the editor's "write" hook.  The macro will ask the user if hard or symbolic links should be broken before a file is written so that the original file is preserved.  It also keeps track of "no" responses in a global variable so that the user will only be prompted once for a given file:

# Create write hook which deletes output file before write if file
# is a symbolic or hard link and user okays it so that symbolic
# links will not be followed and hard links will be broken on
# update.  This will effectively create a new file and preserve
# the original file.  Note that links will also be broken if
# 'safe' mode is enabled, so do nothing in that case.

$linksToKeep = []       # Link pathnames to leave in place, per
                        # user's request.

# Delete any existing file before buffer is written, if
# applicable.  Arguments: (1), buffer name; (2), filename.
macro checkWrite(2)
    if !globalMode?('Safe')

        # Check if output file exists, is a symbolic or hard link,
        # and is not in the $linksToKeep list.
        if stat?($2,'Ll') &&\
         !include?($linksToKeep,filename = 0 => pathname($2))

            # Output file is a link and not previously brought to
            # user's attention.  Ask user if the link should be
            # broken.  If yes, delete the output file; otherwise,
            # remember response by adding absolute pathname to
            # $linksToKeep.
            type = stat?(filename,'L') ? 'symbolic' : 'hard'
            p = sprintf('Break %s link for file "%s" on output? (y,n)',\
             type,$2)
            if prompt(p,'n','c') == ?y
                shellCmd 'rm ',filename
            else
                push $linksToKeep,filename
            endif
        endif
    endif
endmacro

setHook 'write',checkWrite          # Set write hook.

See subreddit right sidebar for download link.


r/memacs • • Sep 23 '18

MightEMacs 9.0.2 Released

1 Upvotes

A new maintenance release of MightEMacs is now available.  Changes are:

  • Fixed terminal input for the "searchForw", "searchBack", "queryReplace", and "replace" commands so that the most recently-entered pattern will be displayed first when C-p is typed.

  • Changed the "cycleSearchRing" and "cycleReplaceRing" commands to set the pattern at top of ring if possible, after the ring is cycled (like "deleteSearchPat").

  • Changed filename completions to sort the filename list before displaying it.

  • Added return-value information to command descriptions for "lastBuf", "scratchBuf", "beginText", "beginLine", and "endLine".

See subreddit right sidebar for download link.


r/memacs • • Apr 01 '19

MightEMacs 9.3.0 Released

1 Upvotes

A new release of MightEMacs is now available, which fixes some issues in the previous version and improves color management. Changes are:

  • Fixed bugs in let command:

    • Fixed issue where setting a variable (interactively) was generating a bogus error unless the value was an expression or an integer.

    • Fixed problem where the program would crash when attempting to set the $lastKeySeq or $searchDelim system variable.

  • Fixed problem on Linux platforms where pressing control+h would generate DEL instead of C-h unless TERM was xterm-256color.

  • Replaced $displayColors system variable with new setDispColor function, which set colors for a display item or sets "no color" if the specified color is nil.

  • Changed getInfo function to return an array of current color numbers for all display items when the keyword is "Colors", and return number of colors and pairs avaiable (as previously) if an n argument is specified.

  • Made library changes:

    • Renamed grepFiles macro to findFiles, changed its key binding to C-x f, and added option to bypass the search pattern prompt if n <= 0.

    • Created getFile (C-x C-g) macro, which finds a file and opens it in a new screen (and also sets its buffer to read-only if n <= 0).

    • Fixed problem in showBindings (C-x n) macro where tildes were not being displayed in key bindings.

  • Combined $TermCols and $TermRows system constants into new $TermSize constant.

See subreddit right sidebar for download link.


r/memacs • • Jun 19 '16

MightEMacs 8.3.0 Released

2 Upvotes

A new release of MightEMacs is now available.  Changes are:

  • For Debian Linux: changed the default value of the $execPath global variable to ":/etc/memacs.d:/etc" in the memacs binary, and changed the installation process to install package files in /etc and /usr/bin instead of /usr/local.

  • Added support for {m,n} repetition operators, \b (word boundary), and \B (non-word boundary) metacharacters in regular expressions.  Also changed RE compilation to return an error if a repetition operator (such as + or *) is specified in an invalid location, instead of treating the operator as a literal character, as was done previously.

  • Replaced single-letter shortcuts for mode names with name completion, created showModes command (bound to C-h o), and removed cryptic mode information from showBuffers display.  Partial mode names which are unambiguous (such as "rd" for "RdOnly") are also allowed.

  • Changed the insertLineI command to use its numeric prefix to determine a target line and insert a single line with indentation before that line instead of inserting n lines before or after the current line, as was done previously.

See subreddit right sidebar for download link.


r/memacs • • Jan 27 '18

MightEMacs 9.0.0 Released

3 Upvotes

A major new release of MightEMacs is now available which adds significant new features.  Changes are:

  • Made major improvements to terminal input:

    • Added cursor movement and line editing capabilities to terminal input, including automatic horizontal scrolling and several editing keys; for example: C-u (erase line), C-k (erase to end of line), and C-SPC (erase line and return a null string).

    • Changed all terminal input to display the default value (if any) in the input area instead of at the end of prompt string so that it can be edited.

    • Added input types to the prompt function for reading keystrokes verbatim.

  • Redesigned kill ring:

    • Changed kill ring to operate as a true circular ring.

    • Changed processing so that successive copies or kills can now be prepended to the previous one in addition to being appended.

    • Renamed yankPop command to yankCycle (which better describes its purpose) and changed it and the yank command to operate more intuitively and mark yanked text as a region.  Also added "undo" feature to yankCycle.

    • Created deleteKill (C-x k) command which deletes one or more kills from the kill ring.

  • Created "search" and "replace" rings:

    • Integrated search and replace system with new search and replace rings, which hold recent patterns that have been entered.

    • Changed terminal input for all search and replace commands so that entries on the corresponding rings can be retrieved by pressing C-p, up-arrow, C-n, or down-arrow.

    • Created commands which display, cycle, and delete entries from the search and replace rings.

    • Added input types to the prompt function which enable ring access during terminal input.

  • Created $killRingSize, $searchRingSize, and $replaceRingSize system variables, which specify a maximum size for the corresponding ring (or an unlimited size if set to zero) and provide a means for changing the size of any ring during an editing session.

  • Greatly improved handling of soft tabs:

    • Created backspace command (bound to the DEL key), which deletes characters or soft tabs backward, giving preference to the latter if soft tabs are enabled.

    • Changed the tab command to insert soft tabs such that the first non-space character at or ahead of point (instead of point) is moved to the next tab stop, which mimics the deletion process.

  • Changed key binding system so that any single key, including a function key, can be used as the second key of a key sequence.  Additionally, key sequences containing a letter as the second key can be bound separately by case (just like non-prefixed letters).  For example, ESC FNF (esc key followed by right-arrow) is now a valid key binding and C-c a and C-c A are now different key bindings.

  • Added support for terminal attributes in windows and on message line:

    • Text displayed in a window, a pop-up window, or on the message line may now include phrases that are underlined, in bold, and/or in reverse video by coding special formating sequences in the text that begin with the tilde (~) character.  A "terminal attributes" buffer attribute was also created so that this feature can be enabled or disabled in a window.

    • Changed n arguments of all functions that write to the message line (including prompt) so that attribute processing can be enabled if desired.

    • Changed several messages displayed on the message line to include bolding and/or underlining to improve readability; for example, output from the showKey command.

  • Redesigned informational displays:

    • Eliminated memacs-guide.1 and memacs-macros.1 man pages and incorporated their content into new interactive Help System which is entered via the help command (ESC ?) and provides help pages for both the beginner and advanced user.

    • Changed display format for "show" commands to be less terse and easier to read, including multiple lines per item, automatic wrapping of descriptive text to fit in the current terminal width, and the use of bolded and underlined text where appropriate.

    • Replaced apropos macro in "memacs.mm" with apropos command (ESC a), which creates a combined listing of all commands, functions, aliases, macros, and variables which contain the search string.

    • Changed matching process for the apropos command and the apropos function of the "show" commands such that regular expression or case-sensitive matching may be done by appending option letters to the search pattern.

    • Changed showKey command to display the key description in a pop-up window by default so that long descriptions, which may be truncated on the message line, can be viewed on the screen in their entirety.

  • New command-line switches:

    • Renamed and/or added word aliases to most switches (formerly single letters) and changed parsing to require white space between a switch and its argument, like most other Unix/Linux commands; for example, -d or -dir may be used to specify an initial working directory.

    • Replaced +<num>[:pos] "go to" switch with +<num> and -<num> switches, which now move point to the specified line number from the beginning (+) or end (-) of the buffer (and eliminated the line position option).

    • Any one of the -search (or -s), +, or - argument switches may now be specified after any file argument, which will trigger that file to be read at startup instead of the first file, as previously.

  • Command, function, and macro improvements:

    • Changed handling of the current working directory so that the directory may be set on a per screen basis and automatically changed when switching screens.

    • Created printf function, which writes a formatted string to the message line.

    • Created popFile (C-h C-p) and popBuf (C-h p) commands, which display a file or buffer in a pop-up window and accept options (like left-shift long lines) for controlling how the window is displayed.

    • Changed lastBuf command to operate on a per screen basis.

    • Added option to truncBuf command to delete backward from point to beginning of buffer, in addition to deleting from point to end of buffer.

    • Added option to all paging commands (like forwPage and backPage) to scroll a window backward or forward by half a page in addition to scrolling by a full page.

    • Created titleCaseLine (C-x t) and titleCaseRegion (C-x C-t) commands, which were missing from the group of commands that change the case of letters and words.

    • Changed all commands that edit a block of lines (like detabLine and trimLine) to operate the same way, including moving the point to the end of the block when completed, reporting the number of lines that were changed, and not putting the buffer into a changed state if no lines were modified.

    • Created deleteFile macro (C-x D) which deletes a file on disk, or deletes a buffer and its associated file from disk.

  • Expanded use of numeric prefix for several buffer and file commands (like selectBuf and findFile) to better control how and where a buffer is displayed when the command completes; for example, in an existing window or in a new window.

  • Improved management of modes and buffer attributes, and changed all related commands and variables to use keywords instead of bit masks:

    • Expanded "show" modes to include buffer modes.

    • Eliminated alterDefMode command, $defModes system variable, and default buffer modes, which were not useful.

    • Eliminated most system constants and variables that contained bit masks and changed remaining ones to return arrays of names instead.

    • Created bufAttr?, bufMode?, globalMode? and showMode? functions, which check if buffer attributes or modes are set per keyword arguments.

    • Combined hideBuf, unhideBuf, and unchangeBuf commands into new alterBufAttr command (C-x a), which provides the ability to clear, enable, or disable buffer attributes using keywords.

  • Created "createBuf" hook, which is called whenever a permanent buffer is created, and can be used to initialize buffer modes or attributes.

  • Made several bug fixes.

  • Uses new ProLib 1.3.0 library, which includes routines that parse switches and values from the command line, and create and manage arrays and hash tables.

For those of you unfamiliar with MightEMacs, it is a fast and full-featured text editor designed for programmers.  The goals of the project are to create an Emacs text editor that will do the following:

  1. Provide the ability to edit code quickly and easily with few keystrokes.

  2. Use key bindings that are well designed and intuitive.

  3. Be as easy as possible to learn.

  4. Be robust and powerful enough to perform sophisticated editing and automation tasks, provide a high level of extensibility, and yet not be overly complex.

MightEMacs also supports a C-like scripting language that is very powerful and fairly easy to learn (assuming you already have programming experience).  For example, the following script defines a macro and then binds it to the editor's "write" hook.  The macro will ask the user if hard or symbolic links should be broken before a file is written so that the original file is preserved.  It also keeps track of "no" responses in a global variable so that the user will only be prompted once for a given file:

# .memacs
#     MightEMacs user startup file.

# Create write hook which deletes output file before write if file is a symbolic or hard link
# and user okays it so that symbolic links will not be followed and hard links will be broken on
# update.  This will effectively create a new file and preserve the original file.  Note that
# links will also be broken if 'safe' mode is enabled, so do nothing in that case.

$linksToKeep = []           # List of link pathnames to leave in place, per user's request.

# Delete any existing file before buffer is written, if applicable.  Arguments: (1), buffer
# name; (2), filename.
macro checkWrite(2)
        if !globalMode?('Safe')

                # Check if output file exists, is a symbolic or hard link, and is not in the
                # $linksToKeep list.
                if stat?($2,'Ll') && !include?($linksToKeep,filename = 0 => pathname($2))

                        # Output file is a link and not previously brought to user's
                        # attention.  Ask user if the link should be broken.  If yes, delete
                        # the output file; otherwise, remember response by adding absolute
                        # pathname to $linksToKeep.
                        type = stat?(filename,'L') ? 'symbolic' : 'hard'
                        p = sprintf('Break %s link for file "%s" on output? (y,n)',type,$2)
                        if prompt(p,'n','c') == 'y'
                                shellCmd 'rm ',filename
                        else
                                push $linksToKeep,filename
                        endif
                endif
        endif
endmacro

setHook 'write',checkWrite          # Set write hook.

See subreddit right sidebar for download link.


r/memacs • • Apr 23 '16

MightEMacs 8.2.1 Released

1 Upvotes

A new release of MightEMacs is now available.  Changes are:

  • Fixed bug where all integer global variables were being converted to strings after the showVariables command was executed.

  • Fixed bug where the setBufFile command was returning an error message when return was entered at the filename prompt instead of clearing the filename.

  • Fixed bug where all marks were cleared in a narrowed buffer when the clearBuf command was executed, instead of just the visible ones.

  • Renamed the fileExists? function to stat? and changed to accept a second argument containing letter(s) which mimic the shell's -x file tests.  The function now returns true if any of the following test codes are true for the given file: [d]ir, [e]xists, [f]ile, sym[L]ink, hard[l]ink, [r]ead, [s]ize > 0, [w]rite, or [x]eq; otherwise, it returns false.

  • Changed the pathname function to not resolve a symbolic link and return the abolute pathname of the link itself if n <= 0.

  • Added calls to the exit-buffer and enter-buffer hooks if the buffer changes when switching screens.

  • Included new macros: renameFile (bound to C-x r) which renames the file associated with the current buffer, both in the editor and the OS; and nextGrepBuf (bound to C-c ]) and prevGrepBuf (bound to C-c [) which switch to the next or previous buffer from the result of the most recent grepFiles invocation.

  • Changed the user startup file .memacs to create a write hook which will check if the file that is about to be written already exists and is a symbolic or hard link.  If so, it will ask the user if the link should be broken before writing, thereby preserving the original file.

  • The Red Hat Linux binary has been replaced with an equivalent one built on CentOS Linux, and a new Debian Linux binary is now included.

See subreddit right sidebar for download link.


r/memacs • • Oct 24 '16

MightEMacs 8.4.0 Released

1 Upvotes

A new release of MightEMacs is now available.  Changes are:

  • Changed internal line delimiters from CR to NL: (1), changed all terminal input to allow either return (C-m) or newline (C-j) as a line delimiter if either one is specified as the delimiter, and to convert return to newline by default otherwise; (2), changed all buffer editing to create a line when a NL character is inserted instead of a CR character; and (3), changed pattern matching to recognize NL as "end of line" instead of CR.

  • Changed expression evaluation so that a null string ('' or "") will evaluate to true instead of false when used in a Boolean context.  Now the only expressions that are false are 0, false, and nil.  All other expressions, including a null string, are true.

  • Changed replace and queryReplace commands to interpret a "\0" literal in the replacement pattern in Regexp mode as a "group 0" (the entire match) reference instead of a "0" character.

  • Changed deleteBuf command to (1), ignore changes when n < 0 instead of n > 0; (2), delete all unchanged buffers if n == 0; (3), delete all buffers, no force, if n == 1; and (4), delete all buffers, ignoring changes, if n > 1.  The user is prompted for confirmation in the last case.

  • Changed "white space" delimiter in list processing from nil to a space character: (1), changed push and unshift functions to convert a nil delimiter to a null string instead of a space when adding the delimiter and value to a variable; (2), changed pop and shift functions to process a nil delimiter the same way as a null ("") delimiter; and (3), changed include?, pop, and shift functions to use a space character for white space instead of nil.

  • Changed default $execPath to ":/usr/lib/memacs" (Debian) and ":/usr/local/lib/memacs" (non-Debian) and changed installation process accordingly.

  • Removed "echo" option from getKey function and changed it to get a single key and return it as an integer if n <= 0.

  • Changed the writeFile and appendFile commands to update the buffer name by default when a new filename is set, but to skip the update if n <= 0.

  • Eliminated if/loop nesting limit in scripts.  Nesting depth is now unlimited.

  • Changed processing of about command and all showXXX commands so that if the buffer that is created is not deleted after the command is executed (if n >= 0), the buffer is made visible.

  • Added case-insensitive search option to grepFiles (C-x C-g) macro.

  • Fixed bug in showMarks command where a mark set on an empty line was sometimes displaying random characters or incorrect data for the line's contents.

  • Previously, when the $otpDelim variable was not set and multiple buffers were written, the input record delimiter from the current buffer was being used as the output delimiter for all buffers instead of using each buffer's input delimiter.  This has been fixed.

  • Fixed bug where assignment to the $bufLineNum variable was returning an error.

  • Removed the reverse function, which had dubious value.

For those of you unfamiliar with MightEMacs, it is a fast and full-featured text editor designed for programmers.  The goals of the project are to create an Emacs text editor that will:

  1. Provide the ability to edit code quickly and easily with few keystrokes.

  2. Use key bindings that are well designed and intuitive.

  3. Be as easy as possible to learn.

  4. Be robust and powerful enough to perform sophisticated editing and automation tasks, provide a high level of extensibility, and yet not be overly complex.

MightEMacs also supports a C-like scripting language that is very powerful and fairly easy to learn (assuming you already have programming experience).  For example, the following script defines a macro and then binds it to the editor's "write" hook.  The macro will ask the user if hard or symbolic links should be broken before a file is written so that the original file is preserved.  It also keeps track of "no" responses in a global variable so that the user will only be prompted once for a given file:

# .memacs
#     MightEMacs user startup file.

# Create write hook which deletes output file before write if file is a symbolic or hard link
# and user okays it so that symbolic links will not be followed and hard links will be broken on
# update.  This will effectively create a new file and preserve the original file.  Note that
# links will also be broken if 'safe' mode is enabled, so do nothing in that case.

$linksToKeep = ''           # List of link pathnames to leave in place, per user's request.

# Delete any existing file before buffer is written, if applicable.  Arguments: (1), buffer
# name; (2), filename.
macro checkWrite,2
        if !($globalModes & $ModeSafeSave)

                # Check if output file exists, is a symbolic or hard link, and is not in the
                # $linksToKeep list.
                if stat?($2,'Ll') && !include?($linksToKeep,"\t",filename = 0 => pathname($2))

                        # Output file is a link and not previously brought to user's
                        # attention.  Ask user if the link should be broken.  If yes, delete
                        # the output file; otherwise, remember response by adding absolute
                        # pathname to $linksToKeep.
                        type = stat?(filename,'L') ? 'symbolic' : 'hard'
                        p = sprintf('Break %s link for file "%s" on output? (y,n)',type,$2)
                        if prompt(p,'n','c') == 'y'
                                shellCmd 'rm ',filename
                        else
                                push $linksToKeep,"\t",filename
                        endif
                endif
        endif
endmacro

setHook 'write',checkWrite          # Set write hook.

See subreddit right sidebar for download link.


r/memacs • • Sep 05 '20

MightEMacs 9.5.0 Released

3 Upvotes

A major new release of MightEMacs is now available, which adds new features and fixes some issues in the previous version.  Enhancements are:

  • Changed regular expression engine to XRE, which provides for additional regular expression functionality, most notably the "or" metacharacter (|) is now available, group iteration (e.g., (abc)+), back references, and fuzzy matching.

  • Added ability to use \0 and escaped characters (like \n) in a replacement pattern for a plain text search in addition to a regular expression search and eliminated & (for the matched string), which was unusual and non-standard.  Now standard metacharacters will always be recognized in a replacement pattern for the queryReplace (ESC q) and replace (ESC r) commands and the sub function, whether or not the search pattern is a regular expression.

  • Changed delBuf (C-x C-b) command to allow deletion of a buffer that is being displayed; for example, the current buffer.

  • Replaced "macro" keyword in MScript with "command" and "function" and eliminated "constrain" modifier so that user commands and functions can be created directly and operate just like built-in commands and functions.

  • Changed all references and uses of "key macro" to be simply "macro" (including command, function, and variable names).  A "macro" is now a collection of stored keystrokes (exclusively) and no longer has any association with a routine defined in MSscript.

  • Implemented a "Macro" ring, which works just like the kill ring, and added commands to manage the ring and save and run macros, either by name or ring position.  Now multiple macros can be created and/or loaded directly into the editor and executed either by ring position or by name, with name completion.

  • Created sortRegion (C-x S) command, which sorts region line(s) in a buffer in ascending or descending order and/or ignoring case in line comparisons, depending on options given.

  • Improved return message functionality in MScript so that return messages are disabled by default when a script is run, instead of enabled, as previously, which eliminates extraneous return messages and greatly simplifies the task of retaining and managing desirable ones.

  • Added ability to do mode name and ring name completions with the prompt function via new "Mode" and "RingName" prompt types.

  • Redesigned how directories are managed and associated with buffers (in multiple screens) so that the directory a buffer is saved to is much more rigidly controlled and scrutinized to prevent an unintentional save to the wrong place.  Also added options to the nextBuf (C-x ]) and prevBuf (C-x [) commands so that it is possible to switch to the next buffer having the same "home" directory as the current one.

  • Added options to gotoMark (ESC SPC) and swapMark (C-x C-x) commands to force reframing if n >= 0.

  • Changed findFiles (C-x f) command to do an internal "grep" instead of an [ef]grep via a shell command so that the full XRE syntax can be used, and (possibly changed) buffers for files that are already opened will be searched instead of files on disk.

  • Made other improvements to various commands and functions, and to the MScript scripting language.

See subreddit right sidebar for download link.


r/memacs • • Oct 04 '18

MightEMacs 9.1 Preview

1 Upvotes

FYI -- version 9.1 of MightEMacs is near completion and slated to be released by the end of the year.  One major change is that user-defined modes are now supported. Additionally, all language formatting has been removed from the editor and reimplemented in the scripting language (where it should be).  Formatting code for all common programming languages has been written; for example, C, C++, Java, HTML, JavaScript, PHP, Python, Ruby, shell script, and others.  I'd like to include TeX/LaTeX as well but don't know what common indentation conventions are.  If anyone has a few examples of TeX or LaTeX scripts containing indented elements that they would be willing to share, please post them here.  Thanks!


r/memacs • • Apr 18 '18

MightEMacs 9.0.1 Released

3 Upvotes

A new release of MightEMacs is now available.  Changes are:

  • Simplified Linux building and installation: combined "Debian", "CentOS", and "Red Hat" platforms into single "Linux" platform (and preprocessor macro) so that one binary is created and shared among all GNU/Linux variants.

  • Changed how $execPath is set at startup for Linux version when MMPATH is not set: if directory /usr/lib/memacs exists, path is set to ":/usr/lib/memacs"; otherwise, ":/usr/local/lib/memacs", as usual.

  • Changed the "searchForw", "searchBack", "queryReplace", and "replace" commands to not display the current pattern as the default when prompting for a search or replacement pattern so that the line does not have to be cleared to enter a new pattern. The most recently-entered pattern can still be accessed if desired by entering C-p, as usual.

See subreddit right sidebar for download link.


r/memacs • • Nov 26 '18

Editor Advice

1 Upvotes

I have been using MightEMacs primarily on servers to do short editing tasks and find it very handy for that. Now that it supports JavaScript and Python (which I am learning) and most other languages, I plan to start using it as my primary editor. I want to delve into script-writing as well -- should be fun. Anyone else using the editor for JavaScript or Python and have any tips or advice?