JuliaEditorSupport / julia-emacs

Julia support in Emacs.
Other
288 stars 62 forks source link

structs are not indented #94

Closed wgmitchener closed 4 years ago

wgmitchener commented 4 years ago

I'm using emacs-26.2-2.fc31.x86_64 with julia-mode-20191128.1452 in melpa. I can get it to indent functions, but it doesn't indent structs at all. Didn't earlier versions indent structs?

struct Example x::Float64 # should be indented when I hit tab but it doesn't work end

non-Jedi commented 4 years ago

Can you confirm that your active major mode is actually Julia mode? There's an issue with the version on melpa right now that can cause julia-mode to fail to load: https://github.com/JuliaEditorSupport/julia-emacs/issues/91

wgmitchener commented 4 years ago

Result of C-h m is:

Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Blink-Cursor Centaur-Tabs Diff-Auto-Refine Doom-Modeline Eldoc Electric-Indent File-Name-Shadow Font-Lock Global-Auto-Revert Global-Eldoc Global-Font-Lock Global-Hl-Line Line-Number Menu-Bar Mouse-Wheel Recentf Shell-Dirtrack Show-Paren Tex-Pdf Tex-Source-Correlate Tool-Bar Tooltip Transient-Mark Treemacs-Filewatch Treemacs-Fringe-Indicator Treemacs-Git Treemacs-Icons-Dired Xterm-Mouse

(Information about these minor modes follows the major mode info.)

ESS[julia] mode defined in ‘ess-julia.el’: Major mode for editing julia source. See ‘ess-mode’ for more help.

In addition to any hooks its parent mode ‘julia-mode’ might have run, this mode runs the hook ‘ess-julia-mode-hook’, as the final or penultimate step during initialization.

key binding


TAB julia-latexsub-or-indent ESC Prefix Command

C-M-q prog-indent-sexp

Auto-Composition minor mode (no indicator): Toggle Auto Composition mode. With a prefix argument ARG, enable Auto Composition mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil.

When Auto Composition mode is enabled, text characters are automatically composed by functions registered in ‘composition-function-table’.

You can use ‘global-auto-composition-mode’ to turn on Auto Composition mode in all buffers (this is the default). Auto-Compression minor mode (no indicator): Toggle Auto Compression mode. With a prefix argument ARG, enable Auto Compression mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil.

Auto Compression mode is a global minor mode. When enabled, compressed files are automatically uncompressed for reading, and compressed when writing. Auto-Encryption minor mode (no indicator): Toggle automatic file encryption/decryption (Auto Encryption mode). With a prefix argument ARG, enable Auto Encryption mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil.

(fn &optional ARG) Blink-Cursor minor mode (no indicator): Toggle cursor blinking (Blink Cursor mode). With a prefix argument ARG, enable Blink Cursor mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil.

If the value of ‘blink-cursor-blinks’ is positive (10 by default), the cursor stops blinking after that number of blinks, if Emacs gets no input during that time.

See also ‘blink-cursor-interval’ and ‘blink-cursor-delay’.

This command is effective only on graphical frames. On text-only terminals, cursor blinking is controlled by the terminal.

(fn &optional ARG) Centaur-Tabs minor mode (no indicator): Toggle display of a tab bar in the header line. With prefix argument ARG, turn on if positive, otherwise off. Returns non-nil if the new state is enabled.

key binding


C-c Prefix Command

Prefix Command centaur-tabs--groups-menu centaur-tabs-backward centaur-tabs-forward C-c centaur-tabs-forward-group C-c centaur-tabs-local-mode C-c centaur-tabs-backward C-c centaur-tabs-forward C-c centaur-tabs-backward-group (fn &optional ARG) Diff-Auto-Refine minor mode (no indicator): Toggle automatic diff hunk highlighting (Diff Auto Refine mode). With a prefix argument ARG, enable Diff Auto Refine mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. Diff Auto Refine mode is a buffer-local minor mode used with ‘diff-mode’. When enabled, Emacs automatically highlights changes in detail as the user visits hunks. When transitioning from disabled to enabled, it tries to refine the current hunk, as well. (fn &optional ARG) Doom-Modeline minor mode (no indicator): Toggle doom-modeline on or off. (fn &optional ARG) Eldoc minor mode (indicator ElDoc): Toggle echo area display of Lisp objects at point (ElDoc mode). With a prefix argument ARG, enable ElDoc mode if ARG is positive, and disable it otherwise. If called from Lisp, enable ElDoc mode if ARG is omitted or nil. ElDoc mode is a buffer-local minor mode. When enabled, the echo area displays information about a function or variable in the text where point is. If point is on a documented variable, it displays the first line of that variable’s doc string. Otherwise it displays the argument list of the function called in the expression point is on. (fn &optional ARG) Electric-Indent minor mode (no indicator): Toggle on-the-fly reindentation (Electric Indent mode). With a prefix argument ARG, enable Electric Indent mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. When enabled, this reindents whenever the hook ‘electric-indent-functions’ returns non-nil, or if you insert a character from ‘electric-indent-chars’. This is a global minor mode. To toggle the mode in a single buffer, use ‘electric-indent-local-mode’. File-Name-Shadow minor mode (no indicator): Toggle file-name shadowing in minibuffers (File-Name Shadow mode). With a prefix argument ARG, enable File-Name Shadow mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. File-Name Shadow mode is a global minor mode. When enabled, any part of a filename being read in the minibuffer that would be ignored (because the result is passed through ‘substitute-in-file-name’) is given the properties in ‘file-name-shadow-properties’, which can be used to make that portion dim, invisible, or otherwise less visually noticeable. Font-Lock minor mode (no indicator): Toggle syntax highlighting in this buffer (Font Lock mode). With a prefix argument ARG, enable Font Lock mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. When Font Lock mode is enabled, text is fontified as you type it: - Comments are displayed in ‘font-lock-comment-face’; - Strings are displayed in ‘font-lock-string-face’; - Certain other expressions are displayed in other faces according to the value of the variable ‘font-lock-keywords’. To customize the faces (colors, fonts, etc.) used by Font Lock for fontifying different parts of buffer text, use M-x customize-face. You can enable Font Lock mode in any major mode automatically by turning on in the major mode’s hook. For example, put in your ~/.emacs: (add-hook 'c-mode-hook 'turn-on-font-lock) Alternatively, you can use Global Font Lock mode to automagically turn on Font Lock mode in buffers whose major mode supports it and whose major mode is one of ‘font-lock-global-modes’. For example, put in your ~/.emacs: (global-font-lock-mode t) Where major modes support different levels of fontification, you can use the variable ‘font-lock-maximum-decoration’ to specify which level you generally prefer. When you turn Font Lock mode on/off the buffer is fontified/defontified, though fontification occurs only if the buffer is less than ‘font-lock-maximum-size’. To add your own highlighting for some major mode, and modify the highlighting selected automatically via the variable ‘font-lock-maximum-decoration’, you can use ‘font-lock-add-keywords’. To fontify a buffer, without turning on Font Lock mode and regardless of buffer size, you can use M-x font-lock-fontify-buffer. To fontify a block (the function or paragraph containing point, or a number of lines around point), perhaps because modification on the current line caused syntactic change on other lines, you can use M-o M-o. You can set your own default settings for some mode, by setting a buffer local value for ‘font-lock-defaults’, via its mode hook. The above is the default behavior of ‘font-lock-mode’; you may specify your own function which is called when ‘font-lock-mode’ is toggled via ‘font-lock-function’. Global-Auto-Revert minor mode (no indicator): Toggle Global Auto-Revert Mode. With a prefix argument ARG, enable Global Auto-Revert Mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. Global Auto-Revert Mode is a global minor mode that reverts any buffer associated with a file when the file changes on disk. Use ‘auto-revert-mode’ to revert a particular buffer. If ‘global-auto-revert-non-file-buffers’ is non-nil, this mode may also revert some non-file buffers, as described in the documentation of that variable. It ignores buffers with modes matching ‘global-auto-revert-ignore-modes’, and buffers with a non-nil value of ‘global-auto-revert-ignore-buffer’. When a buffer is reverted, a message is generated. This can be suppressed by setting ‘auto-revert-verbose’ to nil. This function calls the hook ‘global-auto-revert-mode-hook’. It displays the text that ‘global-auto-revert-mode-text’ specifies in the mode line. (fn &optional ARG) Global-Eldoc minor mode (no indicator): Toggle Eldoc mode in all buffers. With prefix ARG, enable Global Eldoc mode if ARG is positive; otherwise, disable it. If called from Lisp, enable the mode if ARG is omitted or nil. Eldoc mode is enabled in all buffers where ‘turn-on-eldoc-mode’ would do it. See ‘eldoc-mode’ for more information on Eldoc mode. (fn &optional ARG) Global-Font-Lock minor mode (no indicator): Toggle Font-Lock mode in all buffers. With prefix ARG, enable Global Font-Lock mode if ARG is positive; otherwise, disable it. If called from Lisp, enable the mode if ARG is omitted or nil. Font-Lock mode is enabled in all buffers where ‘turn-on-font-lock-if-desired’ would do it. See ‘font-lock-mode’ for more information on Font-Lock mode. Global-Hl-Line minor mode (no indicator): Toggle line highlighting in all buffers (Global Hl-Line mode). With a prefix argument ARG, enable Global Hl-Line mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. If ‘global-hl-line-sticky-flag’ is non-nil, Global Hl-Line mode highlights the line about the current buffer’s point in all live windows. Global-Hl-Line mode uses the functions ‘global-hl-line-highlight’ and ‘global-hl-line-maybe-unhighlight’ on ‘post-command-hook’. (fn &optional ARG) Line-Number minor mode (no indicator): Toggle line number display in the mode line (Line Number mode). With a prefix argument ARG, enable Line Number mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. Line numbers do not appear for very large buffers and buffers with very long lines; see variables ‘line-number-display-limit’ and ‘line-number-display-limit-width’. (fn &optional ARG) Menu-Bar minor mode (no indicator): Toggle display of a menu bar on each frame (Menu Bar mode). With a prefix argument ARG, enable Menu Bar mode if ARG is positive, and disable it otherwise. If called from Lisp, also enable Menu Bar mode if ARG is omitted or nil. This command applies to all frames that exist and frames to be created in the future. Mouse-Wheel minor mode (no indicator): Toggle mouse wheel support (Mouse Wheel mode). With a prefix argument ARG, enable Mouse Wheel mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. Recentf minor mode (no indicator): Toggle "Open Recent" menu (Recentf mode). With a prefix argument ARG, enable Recentf mode if ARG is positive, and disable it otherwise. If called from Lisp, enable Recentf mode if ARG is omitted or nil. When Recentf mode is enabled, a "Open Recent" submenu is displayed in the "File" menu, containing a list of files that were operated on recently. Shell-Dirtrack minor mode (no indicator): Toggle directory tracking in this shell buffer (Shell Dirtrack mode). With a prefix argument ARG, enable Shell Dirtrack mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. The ‘dirtrack’ package provides an alternative implementation of this feature; see the function ‘dirtrack-mode’. (fn &optional ARG) Show-Paren minor mode (no indicator): Toggle visualization of matching parens (Show Paren mode). With a prefix argument ARG, enable Show Paren mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. Show Paren mode is a global minor mode. When enabled, any matching parenthesis is highlighted in ‘show-paren-style’ after ‘show-paren-delay’ seconds of Emacs idle time. Tex-Pdf minor mode (no indicator): Minor mode for using PDFTeX. If enabled, PDFTeX will be used as an executable by default. You can customize an initial value, and you can use the function ‘TeX-global-PDF-mode’ for toggling this value. Tex-Source-Correlate minor mode (no indicator): Minor mode for forward and inverse search. If enabled, the viewer can be advised to show the output page corresponding to the point in the source and vice versa. The method to be used can be controlled with the variable ‘TeX-source-correlate-method’. Currently source specials or SyncTeX are recognized. Tool-Bar minor mode (no indicator): Toggle the tool bar in all graphical frames (Tool Bar mode). With a prefix argument ARG, enable Tool Bar mode if ARG is positive, and disable it otherwise. If called from Lisp, enable Tool Bar mode if ARG is omitted or nil. See ‘tool-bar-add-item’ and ‘tool-bar-add-item-from-menu’ for conveniently adding tool bar items. Tooltip minor mode (no indicator): Toggle Tooltip mode. With a prefix argument ARG, enable Tooltip mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. When this global minor mode is enabled, Emacs displays help text (e.g. for buttons and menu items that you put the mouse on) in a pop-up window. When Tooltip mode is disabled, Emacs displays help text in the echo area, instead of making a pop-up window. Transient-Mark minor mode (no indicator): Toggle Transient Mark mode. With a prefix argument ARG, enable Transient Mark mode if ARG is positive, and disable it otherwise. If called from Lisp, enable Transient Mark mode if ARG is omitted or nil. Transient Mark mode is a global minor mode. When enabled, the region is highlighted with the ‘region’ face whenever the mark is active. The mark is "deactivated" after certain non-motion commands, including those that change the text in the buffer, and during shift or mouse selection by any unshifted cursor motion command (see Info node ‘Shift Selection’ for more details). You can also deactivate the mark by typing C-g or M-ESC ESC. Many commands change their behavior when Transient Mark mode is in effect and the mark is active, by acting on the region instead of their usual default part of the buffer’s text. Examples of such commands include M-;, M-x flush-lines, M-x keep-lines, M-%, C-M-%, M-x ispell, and C-x u. To see the documentation of commands which are sensitive to the Transient Mark mode, invoke C-h d and type "transient" or "mark.*active" at the prompt. (fn &optional ARG) Treemacs-Filewatch minor mode (no indicator): Minor mode to let treemacs autorefresh itself on file system changes. Activating this mode enables treemacs to watch the files it is displaying (and only those) for changes and automatically refresh its view when it detects a change that it decides is relevant. A file change event is relevant for treemacs if a new file has been created or deleted or a file has been changed and ‘treemacs-git-mode’ is enabled. Events caused by files that are ignored as per ‘treemacs-ignored-file-predicates’ are counted as not relevant. The refresh is not called immediately after an event was received, treemacs instead waits ‘treemacs-file-event-delay’ ms to see if any more files have changed to avoid having to refresh multiple times over a short period of time. The watch mechanism only applies to directories opened *after* this mode has been activated. This means that to enable file watching in an already existing treemacs buffer it needs to be torn down and rebuilt by calling ‘treemacs’ or ‘treemacs-projectile’. Turning off this mode is, on the other hand, instantaneous - it will immediately turn off all existing file watch processes and outstanding refresh actions. (fn &optional ARG) Treemacs-Fringe-Indicator minor mode (no indicator): Toggle ‘treemacs-fringe-indicator-mode’. When enabled, a visual indicator in the fringe will be displayed to highlight the selected line even more. Useful if hl-line-mode doesn’t stand out enough with your color theme (fn &optional ARG) Treemacs-Git minor mode (no indicator): Toggle ‘treemacs-git-mode’. When enabled treemacs will check files’ git status and highlight them accordingly. This git integration is available in 3 variants: simple, extended and deferred. The simple variant will start a git status process whose output is parsed in elisp. This version is simpler and slightly faster, but incomplete - it will highlight only files, not directories. The extended variant requires a non-trivial amount of parsing to be done, which is achieved with python (specifically python3). It is slightly slower, but complete - both files and directories will be highlighted according to their git status. The deferred variant is the same is extended, except the tasks of rendering nodes and highlighting them are separated. The former happens immediately, the latter after ‘treemacs-deferred-git-apply-delay’ seconds of idle time. This may be faster (if not in truth then at least in appereance) as the git process is given a much greater amount of time to finish. The downside is that the effect of nodes changing their colors may be somewhat jarring, though this effect is largely mitigated due to the use of a caching layer. All versions run asynchronously and are optimized for not doing more work than is necessary, so their performance cost should, for the most part, be the constant time needed to fork a subprocess. (fn &optional ARG) Treemacs-Icons-Dired minor mode (no indicator): Display treemacs icons for each files in a dired buffer. (fn &optional ARG) Xterm-Mouse minor mode (no indicator): Toggle XTerm mouse mode. With a prefix argument ARG, enable XTerm mouse mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. Turn it on to use Emacs mouse commands, and off to use xterm mouse commands. This works in terminal emulators compatible with xterm. It only works for simple uses of the mouse. Basically, only non-modified single clicks are supported. When turned on, the normal xterm mouse functionality for such clicks is still available by holding down the SHIFT key while pressing the mouse button. (fn &optional ARG) [back]
tpapp commented 4 years ago

@wgmitchener : it looks like you are using ESS's julia mode, not this one. Did this one work for you before and break recently, or are you just setting it up?

I merged the fix for the issue @non-Jedi mentioned, please try again once it trickles through MELPA (if that's what you are using for installation).

wgmitchener commented 4 years ago

Ah! Sorry about that. There was a mistake in my .emacs file. Now that I've fixed it, indentation is working correctly.