texts: Have compilation errors / grep match reuse current frame/window without ever splitting it?

texts:
I have searched in a number of places (1, 2, 3, 4) even looked at the e-lisp source files and could not figure out how to do, so I ask.

Context

I have bound next-error to a key. I'm in some source code buffer and press the key. When walking to next error (compilation, grep, etc), emacs always makes sure to show the error buffer and the source code buffer.

What emacs does

The problem is, it insists in showing them in the same frame, splitting the current frame.

What I want

Always show source code / grep match in the window which happens to be selected at the time next-error is run.

never split that window (customizing split-*-threshold is not enough)
if next-error brings to another source file, show it in current window, no split, no new frame (dedicated buffers don't seem to be enough).

Regarding "compilation error"/"grep" buffer, if it is shown in any window, scroll to the appropriate line. Never split any window.

Accepted variants

Not to ask for more, but be more open to variations.
For example, existing emacs logic may make some variants actually easier to implement:

Similar to what ediff does when switching to next difference, if a frame currently shows the compilation/grep buffer, then putting that frame on top is acceptable.
If no frame currently shows the compilation/grep, it is acceptable either to not show it, or to open a new frame showing it.

One possible implementation

Just removing any attempt to split or make buffer visible would be acceptable.

How to do that?


texts: Why is emacs creating multiple nested bak/ folders?

texts:
I recently tried to back up and move my .emacs.d to another folder and got the error down below. Does anyone know why my system is generating all of these bak/ folders? Also, is it safe to delete these folders?

Mac OS High Sierra 10.13.4
Emacs 25.2

Of course, I'm assuming that this is an Emacs issue, but really I have no idea so any help would be greatly appreciated!

cp: /Users/lorenschwartz/Dropbox/emacsd/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak/bak: name too long (not copied)


texts:
I am missing (or not aware) of a feature in ESS to run some R code on selected text. When editing a script, like

df1 <- data.frame(a=1:100,b=rnorm(100))

I often want to see head(df1) in my terminal. I'd like to be able to move the cursor to df1 and run an elisp function that sends head(df1) to the R terminal.  Can you direct me to how to do that, please? If I can define a few R-functions in Elisp functions and assign them to shortcuts, it would often ease my workflow.


texts: Org-mode: How to LaTeX export "$n$-" correctly?

texts:
I have notes containing many of the following type of LaTeX fragments

$p$-adic ... $n$-th ...

But org-mode exports them as literal dollar sign instead of math. The problem seems to be the
-
directly following the second dollar sign.

How can I change this behavior?


texts: ibuffer not displaying "*mu4e-main*" buffer

texts:
Upon opening mu4e, I expect the *mu4e-main* buffer to appear in the list generated by M-x ibuffer. However, even after typing / /, i.e., M-x ibuffer-filter-disable, the *mu4e-main* buffer is not in the list.

Is there some property of buffers that ibuffer always excludes by default? I was unable to find any such setting.


texts: Showing Org-Mode Table Plots as Images on Export?

texts:
Is there a way to make gnuplot plots from tables as per:

#+PLOT: title:"Grades in Physics and Mathematics" ind:2 deps:(3 4) type:2d with:histograms set:"yrange [0:]" set:"xlabel 'Student'" set:"ylabel 'grades'"
|---+--------+-------------+---------|
|   | Grades | Mathematics | Physics |
|---+--------+-------------+---------|
| # | Ben    |         9.2 |     9.9 |
| # | Tom    |         6.7 |     7.7 |
| # | Tim    |         7.5 |     6.7 |
| # | Dean   |         8.0 |     7.0 |

...automatically show the image of the plot when you export to HTML?


texts:
When opening a new file of certain types, I would like some boilerplate to be inserted. That is, when opening a buffer for a file that does not yet exist, insert some predefined text, optionally with some variable interpolation.

Things I can think of as use case:

Insert some license text at the start
Insert #IF_DEFINED_FOO_H directives in new C header files.
Insert some basic targets in a new Makefile


texts: Cannot mark text when inserting into buffer within post-command-hook

texts:
When I add this post-command-hook:

(defun insert-into-a-buffer ()
  (with-current-buffer
      (get-buffer-create "some-buffer")
    (insert "a")))

(add-hook 'post-command-hook 'insert-into-a-buffer :local)

I cannot mark text regions.  This appears to be because some of the commands I use in my post-command-hook function internally set the deactivate-mark to t, which causes the (deactivate-mark) function to be run after I run my post-command-hook function.

I have tried multiple different methods of getting at the stack trace to show me how and why the (deactivate-mark) function is called, but no method has given me a stack trace that includes its caller, so it appears that (deactivate-mark) is the top-level function that is being run.  This corroborates with the answer to this question, which explains that the deactivate-mark variable can be set to t during a command in order for mark to be deactivate after the command.

Exact steps to reproduce:

Run emacs -Q
(optional) Press C-SPC to set mark.  Move point around.  Observe that the region between point and mark is visually highlighted.
Enter the above code, and evaluate it.
Press C-SPC to set mark.  Move point around.  Region between point and mark is not highlighted.

Expected behavior: Region between point and mark is visually highlighted, even after evaluating those 2 lines of elisp.  Actual behavior: Region between point and mark is not highlighted.

The answer linked says that as a possible fix, (setq deactivate-mark nil) can be placed at the end of your command to prevent mark from being deactivated.  However, some commands such as kill-region intentionally and quite correctly set it to t.  If I set (setq deactivate-mark nil) at the end of my command, I  interfere with those commands' correctly deactivating mark once they are run.

That answer also says C-h v deactivate-mark says Automatically becomes buffer-local when set regarding the deactivate-mark variable, but when I run C-h v deactivate-mark, that is not mentioned.  Has this been changed?  I guess I'll need to do a git bisect...


texts: Syntax highlighting not working in src blocks (org babel)

texts:
I'm having some trouble with org src blocks and syntax highlighting - the highlighting is not present in the block, but does appear in the new window that appears when running org-edit-special.
org-src-fontify-natively is already set to t, and the python language is loaded (and the block executes fine).


texts: Doom Emacs: Flycheck cannot find header files in gtkmm-3.0

texts:
I am attempting to use gtkmm-3.0-dev in a small project. It uses meson as its build tool, and I use ninja to create a compilation database. However, regardless of any variables I set, Flycheck cannot seem to find the header files that gtkmm references:

The project itself compiles without any issue, so I have verified that I have the appropriate libraries installed. I checked the actual gtkmm.h file, and all the files that are "not found", are within angle brackets, and are included as a -l option in the compilation command.
Additionally, company-clang works on the Gtk types and functions, so I am fairly sure that the compilation database is correct.
My question is, how can I make Flycheck either look in the correct paths or ignore these errors altogether? For reference, I did modify flycheck-clang-include-path, but this did not change the amount of errors Flycheck reports.
I made a repository on github for this; Here is the commit I am working off of


texts: Color when visualizing latex table in orgmode

texts:
I am using Emacs + orgmode to write text and latex equations. The preview within orgmode (with C-c C-x C-l) works well for latex equations.
However, I noticed that if I display a latex table within orgmode, it uses a black font color, so it is almost invisible in a dark background (screenshot below).

Question: Is it possible to change the font color for previewed tables to be the same as the font color for latex math?


texts:
I'm trying to write a command that upgrades all packages, no questions asked. It looks like:

(defun *-package-upgrade ()
  "Upgrade all packages"
  (interactive)
  (save-window-excursion
    (package-list-packages)
    (with-current-buffer "*Packages*"
      (package-menu-mark-upgrades)
      (package-menu-mark-obsolete-for-deletion)
      (package-menu-execute t))))

However, when it's run, I see:

Importing package-keyring.gpg...done
Waiting for refresh to finish...
user-error: No operations specified
Package refresh done
25 packages marked for upgrading.

Which seems to suggest that package-menu-mark-upgrades is running after package-menu-execute.

I thought package-menu-mark-upgrades may be running asynchronously, but the docstring of the package-menu-async customizable variable says:

  Currently, only the refreshing of archive contents supports asynchronous operations.  Package transactions are still done synchronously.

So I'm not sure what's going on here.

P.S. I've taken a look at a related question, but I'd prefer to write my own command for this.


texts: In Evil mode, how can I prevent adding to the kill ring when I yank text, visual mode over other text, then paste over?

texts:
If I have text1 text2, I yank text1 with yw then I highlight text2 with vw and paste overwrite that text with p, my kill ring now has text2. I'd prefer if text2 wasn't added to my kill ring because next time I paste text, Emacs will paste text2 which I inadvertently copied.

Same question for x (which deletes 1 character), the deleted character goes into my kill ring.

p then C-p to cycle through the kill ring isn't ideal. I paste the text again, the over written text is continually added onto the kill ring leading to more C-p presses to get the original text. Ideally I'm hoping to disable or redefine p when over writing text to not add to the kill ring


texts: How to reset/undo changes in folder using Magit

texts:
I'm looking for a way to undo changes in selected directory, analogue of git checkout [folder-path] in Magit.
I found that I can reset changes of specific file to selected branch by typing X f in magit-status, but I didn't find a way to do the same for folders.
Is there a way to achieve that in Magit?


texts: How do I create a dynamic regexp with rx?

texts:
I want to use rx to create regular expressions with runtime values.

Currently, I'm doing this:

(setq strings '("foo" "bar" "baz"))
(eval `(rx symbol-start (or ,@strings) symbol-end))

However, I'd rather avoid using eval. I've found rx-to-string, but it's not clear what FORM I should write:

;; error: Unknown rx form `symbol-start
(rx-to-string '(symbol-start (or ,@strings) symbol-end))

How do I build an rx expression at runtime?


texts: Elpy keeps prepending backslash to my python path

texts:
I am trying to set my Elpy on my home machine and, so far, everything works except actually running the Python interpreter. I normally launch the interpreter and run code via C-c C-c, but when I do that under the current install I get the following backtrace:

Debugger entered--Lisp error: (file-error "Searching for program" "No such  file or directory" "\\~/anaconda3/bin/python")
  make-process(:name "Python" :buffer #<buffer *Python*> :command ("\\~/anaconda3/bin/python" "-i"))
  apply(make-process (:name "Python" :buffer #<buffer *Python*> :command ("\\~/anaconda3/bin/python" "-i")))
  start-process("Python" #<buffer *Python*> "\\~/anaconda3/bin/python" "-i")
  apply(start-process "Python" #<buffer *Python*> "\\~/anaconda3/bin/python" "-i")
  start-file-process("Python" #<buffer *Python*> "\\~/anaconda3/bin/python" "-i")
  apply(start-file-process "Python" #<buffer *Python*> "\\~/anaconda3/bin/python" "-i")
  comint-exec-1("Python" #<buffer *Python*> "\\~/anaconda3/bin/python" ("-i"))
  comint-exec(#<buffer *Python*> "Python" "\\~/anaconda3/bin/python" nil ("-i"))
  make-comint-in-buffer("Python" "*Python*" "\\~/anaconda3/bin/python" nil "-i")
  apply(make-comint-in-buffer "Python" "*Python*" "\\~/anaconda3/bin/python" nil "-i")
  python-shell-make-comint("\\~/anaconda3/bin/python -i" "Python" t)
  run-python("\\~/anaconda3/bin/python -i" nil t)
  elpy-shell-get-or-create-process()
  elpy-shell--ensure-shell-running()
  elpy-shell-send-region-or-buffer-and-step(nil)
  funcall-interactively(elpy-shell-send-region-or-buffer-and-step nil)
  call-interactively(elpy-shell-send-region-or-buffer-and-step)
  elpy-shell--send-with-step-go(elpy-shell-send-region-or-buffer-and-step nil nil nil)
  elpy-shell-send-region-or-buffer(nil)
  funcall-interactively(elpy-shell-send-region-or-buffer nil)
  call-interactively(elpy-shell-send-region-or-buffer nil nil)
  command-execute(elpy-shell-send-region-or-buffer)

Obviously it is not finding my Python install under \\~/anaconda3/bin/python, most likely due to the prepended \\ in my path (right?).  I ensured my paths are correct in my .emacs file and with elpy-config.  Does anyone have ideas on why this is happening?


texts: Automatically org-export-html to a specific directory

texts:
Every time I publish html files in org-mode, I clutter up my directory with them.

Is there a way to automatically export html files to a specific directory?

I've tried this solution: https://stackoverflow.com/questions/9559753/emacs-org-mode-export-to-another-directory#9560534

However there is no org-export-publishing-directory in my emacs. I'm not sure why.

Thanks for any help.


texts: Fundamental mode doesn't support HideShow minor mode

texts:
I want hs-minor-mode features, I chose it amongst many options I reviewed. How to make it work?

The only package I have atm is web-mode. I put this line in my init file:

(hs-minor-mode)

The error on Emacs startup:

Debugger entered--Lisp error: (error "Fundamental Mode doesn't support Hideshow Minor Mode")
  signal(error ("Fundamental Mode doesn't support Hideshow Minor Mode"))
  error("%s Mode doesn't support Hideshow Minor Mode" "Fundamental")
  hs-grok-mode-type()
  hs-minor-mode()
  eval-buffer(#<buffer  *load*> nil "/home/Miguel/.emacs" nil t)  ; Reading at buffer position 1759
  load-with-code-conversion("/home/Miguel/.emacs" "/home/Miguel/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\262


texts:
I renamed few files using Dired. I noticed helm shows old names in the list of recent files (helm-recentf).

How do I remove the files that do not exist from recent files list?


texts: Org-ref: how to get the BibTex entries in Helm sorted alphabetically?

texts:
I have installed org-ref, and enjoy its functionality when writing notes where I need literature references in my text.

However, when I press the command C-c ], the BibTex entries that are listed in Helm are not alphabetically sorted. That makes it difficult to find the references I want to insert. How can I sort the list of references shown in Helm?

I am using Emacs (25.0.93.1) and org-mode (9.0.1) on my windows 10.


texts:
I'm brand-new to Emacs and I want to put my ~/.emacs.d under version control, much like I've done in the past with my vim setup. I installed a couple packages before initializing a git repo, and now I'm sifting through the contents of emacs.d trying to figure out what came from where, and what I should add to my gitignore.

The folder contents are currently

auto-save-list/
elpa/
url/

I've added auto-save-list to my gitignore, but I'm less clear about the elpa and url directories. I gather elpa houses the packages I've installed, but I'm not sure whether I should put those under version control, and I have no idea what the url directory is about.

Any help/advice to a noob would be much appreciated.


texts: `package` does not delete old version on update

texts:
Whenever package updates a package in Emacs 24.4, and it asks me if I want to delete the previous version, it fails to do so even when I answer y. It gives me the following message:

Delete package `rich-minority-20140821.2020'? (y or n) y
Renaming

Is there a way to fix this?


texts:
Say, I typed

In [1]: def foo(a, b):
...:     return a+b
...:

in the normal, non-emacs ipython shell. Pressing the up arrow key afterwards, allows me to get the complete multi-line input back which I then can edit.

In [2]: def foo(a, b):
    return a+b_

where _ represents the cursor. Can I replicate this behaviour in Emacs's ipython shell?


texts: How does previous-line/next-line "know" the column it should move to from the end of the line

texts:
When I am on a long line, beyond the end of an adjacent line, if I move up or down to the other line the point will go to end of the line, naturally. Then when I move back to the longer line, it goes to the same position I was originally at.

Similarly, if I reach the end of the buffer by pressing down on the last line, when I move up it moves to the column I was in (or the end of the line if the column is from another longer line) rather than the column of the end of the last line.

How does it know what column to move to? This is not goal-column, it is transient (based on the last column explicitly horizontally moved to) rather than permanent.

I would like to control this behavior programmatically, so I would like to know any relevant variables or functions.


texts: How to initiate a prompt for user input based on the prefix argument?

texts:
The below dummy foo describes how I need the prefix variable setting to work.

I'd like the read-number prompt to show up only if the user entered C-u as prefix. In all other cases, the prefix will be read as (interactive "p") would usually do.

(defun foo (prefix)
  ;; (interactive "p") ??
  ;; (interactive (list (read-number "Num: "))) ??
  ;; Only if `C-u' prefix is used, show the prompt for user entry
  ;; else set PREFIX to user entered numeric prefix using
  ;; the C-0/C-1 or M-0/M-1 style.
  (message "prefix = %0d" prefix))
;; Desired outcome
;;  C-0 M-x foo => prefix = 0 (no prompt)
;;  M-6 M-x foo => prefix = 6 (no prompt)
;;  C-u M-x foo => Prompt appears => User enters 7 => prefix = 7


texts: How to check the change log of a layer's update

texts:
I update the layer very often.
How can we see the git log for those updates?
For example, the most recent haskell-mode layer has a bug, and I want to check it.


texts: Display abbreviated form of a function name?

texts:
I've seen videos where someone an elisp function call like

(so-and-so/do-stuff)

But were able to shorted the displayed function name to something like

(so/do-stuff)

How do they do that? I'd like to use it in my init.el so I can display this

(i/do-stuff)

rather than this

(ivan/do-stuff)


texts: Adding text properties to empty strings?

texts:
Is there a way to add text properties to empty strings? As far as I can tell, calling put-text-property on an empty string silently does nothing. I seem to recall reading somewhere that the empty string is (at least potentially) a singleton, so perhaps this is why it doesn't work.

This may seem like a perverse thing to want to do since a text property that doesn't apply to any text is pretty useless. I'm working on a company-mode backend that – for reasons which aren't really important to this question – needs to remember where the completion prefix starts. This is easy to calculate, and after doing so I stash the offset as a text property on the prefix.

However, a prefix can, in some very important cases, be blank. Since I can't add properties to an empty prefix, I'm stuck checking whether the property is blank in lots of places. Hence, my initial question.

If it's not possible to add text properties to blank strings, is there some other way I could transparently associate extra data with the empty prefix string? I know some lisps allow you to tack meta data onto objects, so perhaps there's something like this in elisp. Any ideas would be greatly appreciated.


texts: Why are there 2 exact same Emacs Binaries in the bin folder?

texts: In the Windows Binary release, if you look at the bin folder, you can see a binary file Emacs.exe and another one Emacs25.1.exe, these 2 files are exactly the same.  And it seems that deleting Emacs25.1.exe doesn't affect it in anyway if you use runemacs.exe.  why are there 2 identical files?


texts:
When I grep inside emacs, it begins to be completelly laggy when lines are too long (just try to grep in your home emacs directory and you will see what I mean). How to set limit to line lengths in grep output buffer?

The effect can be reproduced with the following emacs lisp form. One can run the code in the scratch buffer.

(let ((file (make-temp-file "greptest")))
  (with-temp-file file
    (dotimes (i 100)
      (dotimes (j 100)
        (dotimes (k 100)
          (insert (string (+ 32 (random (- 127 32))))))
        (insert "test"))
      (insert "\n")))
  (grep (concat "grep --color -nH --text -e test " file))
  file)

It is clear that the effect depends on the performance of the computer.
So it might be that you need to play around with the numbers to see the lagging.


texts: Incrementing characters in Emacs, next to numbers?

texts:
You can place a pointer on a number, like 1, and increment it to 2.
There are many alternatives on this. See also the Emacs Wiki:

https://www.emacswiki.org/emacs/IncrementNumber

7 alternatives to increment a number under the pointer!
But there is a thing that I still miss.
In Vim, you can increment the number/character under the pointer whether it's a character or a number.

Incrementing an A turns into a B.

Incrementing a 1 turns into a 2.

Emacs seems be to able to increment numbers only, from what I found on Emacs Wiki. Is there any way to dinstinct characters from numbers and increment them accordingly?


texts:
I want search-title-face to be non-bold.

Tried to add to my .emacs file this chunk (due to http://nullprogram.com/blog/2013/11/26/):

(custom-set-faces
 '(elfeed-search-title-face
   ((t :weight normal))))

But it doesn't work.


texts: Can I open emacs in nw mode with the scratch buffer?

texts:
When starting emacs from the shell command line, if you pass the "dot", it opened emacs with a 'dired' of the current directory.

But can I do this?

emacs '*scratch*'

so emacs opens with the focus on the scratch buffer.

# my .bashrc
function emacs() {
  emacsclient -a "" -s workspace -nw "$@"
}


texts:
What is the relationship between the "basic" faces defined in faces.el and "font-lock" faces in font-lock.el?

My initial impression was that basic faces, like bold and fixed-pitch, are based on style rather than semantics. The font-lock faces, in contrast, are based on semantics rather than style.

Closer inspection shows that this is not accurate, however. For example, there is both a warning face in faces.el and a font-lock-warning-face in font-lock.el. There are also some basic faces, like success and error, that are clearly semantic, but without font-lock counterparts.

Is there anything more than historical accident (font-lock, I believe, was introduced by XEmacs, an Emacs fork) that there are two sets of general-purpose faces? Would it be desirable to unify them into a single set? Are there any plans to do so?


texts:
When editing .el files my Emacs is very slow. The larger the file, the worse it behaves, it is especially visible while scrolling or using autocompletion of any kind. It becomes pretty visibly slow at +60 LOC. What's interesting, it only happens Emacs-Lisp mode, I also use Emacs to write Ruby, Elixir and Rust code and those behave just fine.

I went through with disabling the usual suspects, such as Flycheck, Flyspell and Company, but it did not improve a lot. Profiling also did not reveal any abnormal CPU or memory usage. I am using version 25.3 installed through hombrew.

Are there any less obvious things that might be causing this behavior?

Just in case, the list of minor modes for Emacs-Lisp mode are:

Enabled minor modes: Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Auto-Revert Blink-Cursor
Column-Enforce Column-Number Company Completion-In-Region
Delete-Selection Diff-Auto-Refine Diff-Hl Diff-Hl-Flydiff
Diff-Hl-Margin Diff-Hl-Margin Display-Time Electric-Indent
Electric-Pair Evil Evil-Leader Evil-Local File-Name-Shadow Flycheck
Flyspell Font-Lock Global-Diff-Hl Global-Eldoc Global-Font-Lock
Global-Git-Commit Global-Linum Global-Undo-Tree Line-Number Linum
Magit-Auto-Revert Mouse-Wheel Projectile Purpose Rainbow
Rainbow-Delimiters Shell-Dirtrack Tooltip Transient-Mark Undo-Tree
Whitespace Yas Yas-Global

It is not particularly different from the one I am running for Elixir mode, yet Emacs-Lisp is considerably slower:

Enabled minor modes: Alchemist Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Auto-Revert Blink-Cursor
Column-Enforce Column-Number Company Completion-In-Region
Delete-Selection Diff-Auto-Refine Diff-Hl Diff-Hl-Flydiff
Diff-Hl-Margin Diff-Hl-Margin Display-Time Electric-Indent
Electric-Pair Evil Evil-Leader Evil-Local File-Name-Shadow Flyspell
Font-Lock Global-Diff-Hl Global-Eldoc Global-Font-Lock
Global-Git-Commit Global-Linum Global-Undo-Tree Line-Number Linum
Magit-Auto-Revert Mouse-Wheel Projectile Purpose Rainbow
Rainbow-Delimiters Ruby-End Shell-Dirtrack Tooltip Transient-Mark
Undo-Tree Whitespace Yas Yas-Global


texts: How to evaluate Elisp code contained in a string?

texts:
The question pretty much says it all: I have a string containing the source code for a valid Elisp expression, and I would like to evaluate it.

(In Python, for example, the expression eval("1 - 2 + 3") evaluates to 2.)


texts:
In Magit, how can I cancel a git process that is taking too long?

If I did something like git push from a terminal, I could press control-C to cancel. How can I do this from Magit?


texts: Auto evaluate org mode source block on file save

texts:
For example, whenever I edit my config, I run this block to reload the config:

#+begin_src emacs-lisp :tangle no :var data=replace-symlink :results none
(org-babel-load-file (locate-user-emacs-file "/home/user/.emacs.d/config.org"))
(load-file "/home/user/.emacs.d/config.el")
#+end_src

Is there a way to have this run automatically every time I save the file C-x C-s?

I have another file with a src block that generates an xwiki file and updates a web wiki via an API. I'm trying to have org evaluate that block automatically on save as well.

Let me know if there's a straighforward way to do it. This would seem very useful functionality but I didn't come across anything in org docs. It might be solved already by creatively running #+CALL via some save hook?

Thanks!


texts: is there something like org-babel for arbitrary major modes?

texts:
org-babel allows editing source code of arbitrary modes inside an .org file.

I'd like to do this (with different syntactic markers) inside my major mode, but org-babel is very specific to org.

Is there a library that allows one to embed major modes (at least the font-locks) inside a code block in another major mode? Otherwise I guess I need to copy/pasta the relevant parts of org-babel.


texts: How to change the cursor type and color?

texts:
I would like to change the cursor, like in Terminal, from the block to the I-Beam cursor.

From this:

To this:

How would I do this?

Also, on a side note, how do I change the color of the cursor?


texts: "Not allowed in tags-type agenda" using custom agenda

texts:
I set up habits in org mode and using C-k to toggle the habits on/off in the normal agenda is working fine.

However, in my custom agenda (taken from Bernt Hansen GTD implementation link) I get the following error when using C-k:

Debugger entered--Lisp error: (error "Not allowed in tags-type agenda buffers")
signal(error ("Not allowed in tags-type agenda buffers"))
error("Not allowed in %s-type agenda buffers" tags)
org-agenda-check-type(t agenda)
org-habit-toggle-habits()
call-interactively(org-habit-toggle-habits nil nil)
command-execute(org-habit-toggle-habits)

The same is true for changing week and day view:

Debugger entered--Lisp error: (error "Not allowed in tags-type agenda buffers")
signal(error ("Not allowed in tags-type agenda buffers"))
error("Not allowed in %s-type agenda buffers" tags)
org-agenda-check-type(t agenda)
org-agenda-change-time-span(week nil)
org-agenda-week-view(nil)
call-interactively(org-agenda-week-view nil nil)
command-execute(org-agenda-week-view)

Any hints on how to toggle habits in the custom agenda? Or why is toggling not possible in tags-type agendas?

By the way I am using spacemacs 0.105.21 (emacs 24.5.1)

The solution is to change (agenda "" nil) to (agenda "").
Here is a part of the custom agenda:

(setq org-agenda-custom-commands
      (quote (("N" "Notes" tags "NOTE"
               ((org-agenda-overriding-header "Notes")
                (org-tags-match-list-sublevels t)))
              ("h" "Habits" tags-todo "STYLE=\"habit\""
               ((org-agenda-overriding-header "Habits")
                (org-agenda-sorting-strategy
                 '(todo-state-down effort-up category-keep))))
              (" " "Agenda"
               ((agenda "")      ;; delete nil
                (tags "REFILE"
                      ((org-agenda-overriding-header "Tasks to Refile")
                       (org-tags-match-list-sublevels nil)))
                (tags-todo "-CANCELLED/!"
                           ((org-agenda-overriding-header "Stuck Projects")
                            (org-agenda-skip-function 'bh/skip-non-stuck-projects)
                            (org-agenda-sorting-strategy
                             '(category-keep))))
...

Thanks to @elethan


texts: Python.el - Wrong type argument: arrayp, nil

texts:
When I try to do C-c C-c to run my buffer (python.el), I get the error: Wrong type argument: arrayp, nil. This is what the backtrace looks like:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("[^-0-9a-zA-Z_./\n]" "\\\\\\&" nil)
  shell-quote-argument(nil)
  python-shell-parse-command()
  byte-code("^H\203^S^@\301\302\303 \"\304\305!\306^H!\307UE\207\303 \310\311E\207" [current-prefix-arg read-string "Run Python: " python-shell-parse-command y-or-n-p "Make dedicat$
  call-interactively(run-python)
  python-shell-get-or-create-process()
  python-shell-send-region(1 598 nil)
  python-shell-send-buffer(nil)
  call-interactively(python-shell-send-buffer nil nil)
  command-execute(python-shell-send-buffer)

Anyone know what's going on? I'm fairly new to emacs, but C-c C-c has never worked for me because of this error.


texts: how to do a next in a elisp dotimes loop

texts:
By next I mean next as found in ruby/perl/python/etc

#!/usr/bin/ruby

for i in 0..5
   if i < 2 then
      next
   end
   puts "Value of local variable is #{i}"
end


texts: Indentation in makefile: alignment in multi-line assignments

texts:
What is the best solution for writing Makefile, GNU Makefile specifically?

For example:

FILES:= file0.cpp          \
        file1.cpp          \
        file2.cpp          \
        fileYetAnother.cpp

After typing the first \(or after saving the buffer), and ENTER, I want the file1.cpp to align with the file0.cpp, do not mind the \ at the end of each line, I can use align-regexp to align all of them after finished.

But it turns out this by default:

FILES:= file0.cpp  \
file1.cpp          \
file2.cpp          \
fileYetAnother.cpp

I know I can define my own indentation like Customizing indentation in makefile mode?, but it will fix the indentation to number like 4, that is not smart for different situations, what if the FILES word is long.

Besides it does not work for:

all:
        gcc ...

I have to type C-q TAB to indent the gcc ... line.

Another problem for this kind of situation, by default, if you keep typing TAB below the all: line and then type the real commands for all, Emacs will keep inserting Tab when typing TAB, AFAIK, it must be 8 spaces (a Tab exactly） at the beginning of the command line after all, so typing multiple typing-TABs should only remain one TAB.

Is there any package to handle all the messed up format in the Makefile, or you just do that manually?


texts:
In my config file i have the following lines to fix faces for Scala-mode:

(make-face-bold scala-font-lock:lazy-face)
(make-face-bold scala-font-lock:final-face)
(make-face-bold scala-font-lock:private-face)
(make-face-bold scala-font-lock:implicit-face)
(make-face-bold scala-font-lock:abstract-face)
(make-face-bold scala-font-lock:override-face)
(make-face-bold scala-font-lock:sealed-face)

That i would really like to simplify to this:

(mapc
  (lambda (kw) (make-face-bold (make-symbol (format "scala-font-lock:%s-face" kw))))
  '("final" "private" "implicit" "abstract" "override" "sealed" "lazy"))

But it complains with (error "Invalid face" scala-font-lock:final-face). How can i make it work, i.e refer to the face using constructed string?


texts:
org-mode goto last heading in the current tree.

Say This is my org-file, pipe indicates the cursor:

* Top|
** Apple
** Banana
** Cherry
* Middle
** Ape
** Bear
** Cat

I'd like to run a command and have my cursor now be here:

* Top|
** Apple
** Banana
** Cherry|
* Middle
** Ape
** Bear
** Cat


texts: macOS tab feature breaks Emacs new frame behavior; a simple fix?

texts:
Prior to macOS Sierra I would use C-x 5 2 to create a separate frame which was created in an OS X window so that there were now two windows.  This is using the latest EmacsForOSX version straight out of the box.  Life was good.

I recently switched to macOS Sierra and discovered there is now a different behavior: after C-x 5 2 the new window is turned into a tab inside the original Emacs frame (macOS window).  An invisible frame at that if you are using macOS fullscreen mode. That sort of sucks.

Edit:  Note that this behavior only exists in full screen mode so if you exit full screen mode C-x 5 2 does the right thing.

After playing around with the new macOS tab features I discovered that I could exit fullscreen mode to reveal the tabs and drag a tab out to create a separate Emacs frame. Life is better, however this is a rather clumsy way to get separate frames, for example, placed in each monitor on a dual monitor setup.  Is there an easier way to achieve the pre-Sierra Emacs frame behavior in a post-Sierra world?

It strikes me that macOS Sierra breaks the legacy Emacs design decision that an Emacs frame can be modeled as an OS X/macOS window, therefore requiring code changes in Emacs to support the new macOS tab feature. Is anyone aware of Emacs development efforts to accept and deal with this?


texts: compile-goto-error: be more consistent in choosing a window for display

texts:
I have a main window displaying buffer A, and bottom window displaying some project-wide search results.

┌───────────┐
│     A     │
│           │
├───────────┤
│  results  │
└───────────┘

Hitting enter on one of the search results runs compile-goto-error, which ends up calling pop-to-buffer, splitting my main window, and displaying the result on the right:

┌─────┬─────┐
│  A  │ R1  │
│     │     │
├─────┴─────┤
│  results  │
└───────────┘

Swithing back to the results window, hitting enter an another result displays it on the left:

┌─────┬─────┐
│ R2  │ R1  │
│     │     │
├─────┴─────┤
│  results  │
└───────────┘

This annoys me to no end, as I wanted to keep A visible and continue browsing the results on the right. I don't have a strong left/right preference, I just want pop-to-buffer to be consistent in its choice of window. It's currently choosing the least recently used window, and while I can see the reasoning behind that, it forces me into a game of whacka-mole, bouncing between windows, switching between buffers, etc.

The same problem arises when I hit enter on push-button links in a help buffer.

I'm coming from Vim, where the righthand window is consistently used in such scenarios. I'd like to configure Emacs to make this workflow less disorienting. I have something like this in mind:

if the relevant buffer is already visible in an existing window, use that window
if a result was previously displayed, use the same window again if the window is still live
if the main window has not been split (i.e. there's only one window other than the results window), use split-window-sensibly and display buffer in the right/lower split
if the main window has already been split, default to the right/lower split

I'm also open to suggestions for other approaches entirely. I realize that by trying to reproduce a workflow I use in Vim, I might be missing out on a better approach that's achievable in Emacs.

I've written a sort of hacky workaround, though seems to work so far.

(defvar pop-target-window)
(make-variable-buffer-local 'pop-target-window)

(advice-add 'compilation-goto-locus :around #'ivan-around-compilation-goto-locus)

(defun ivan-around-compilation-goto-locus (orig-func &rest args)
  (advice-add 'pop-to-buffer :override #'ivan-pop-to-buffer)
  (apply orig-func args))

(defun ivan-pop-to-buffer (buffer &optional action norecord)
  (advice-remove 'pop-to-buffer #'ivan-pop-to-buffer)
  (let ((from-buffer (current-buffer))
        (reused-window (display-buffer-reuse-window buffer nil)))
    (cond (reused-window
           (select-window reused-window norecord))
          ((and (bound-and-true-p pop-target-window)
                (window-live-p pop-target-window))
           (window--display-buffer buffer pop-target-window 'reuse)
           (select-window pop-target-window norecord))
          (t
           (pop-to-buffer buffer action norecord)
           (with-current-buffer from-buffer
             (setq-local pop-target-window (selected-window)))))))


texts: Package to help display status of each git repo contained in a common directory

texts:
I have a directory and in the directory is a rather long list of git repositories.  Is there a package or options where a dired listing of the directory would also add in the status of each git repo contain.  For example if the git repo is clean and synced, it would show green.  If the repo has local changes, it would show red.  Or... perhaps another method could be used to indicate the current state of the repo.

I have magit installed so that might be an aid in this quest.


texts:
In the good old days, repeated emacs keyboard macros ran without repainting the display until the end. Over the years this changed, and now it appears that the display is redrawn 100% of the time -- which is a bit tedious when I try to run a macro a few million times on a large buffer.

Is there a way to inhibit redraw until all of the repeats are done?

EDIT: Turns out that it can't figure out a reproducer, even though I've seen it a bunch of times. When I do I'll report it as a bug.


texts: Org Src Block does not return any output

texts:
TL;DR: How do I get the stderr of my source block to be part of the #+RESULTS block, without changing the contents of the block? I can only get stdout to appear.

[Long and winding explanation]
While writing this question I found a solution/reason to it not working.
Since I spent quite some time on it, I thought I'd still post it.
Hey there!
I'm relatively new to emacs and org mode especially. Last month, I started writing my bachelor's thesis for applied computer science using org mode (based on dangom's template).
In the thesis, I use org-src blocks to demonstrate stuff.
In this case, I've set up an example to demonstrate warnings from a C Compiler:
#+CAPTION: A simple C-Program without errors, but with a Code Smell
#+NAME: qc:c-code
#+ATTR_LATEX: :placement [H]
#+BEGIN_SRC C :tangle ../sourcecodes/foo.c
// foo.c
#include <stdio.h>

int main() {
    int i=10;
}
#+END_SRC

As you can see, this program is stored in a seperate sourcecodes folder:
├── backmatter
├── frontmatter
├── images
├── library.bib
├── literatur
├── mainmatter
│   └── 03-analysis.org <- This is where I am
├── sourcecodes
│   ├── foo
│   └── foo.c <- and here goes the program
└── thesis

Now, I wish to build that file.
#+CAPTION: ...
#+NAME: qc:c-code-build
#+ATTR_LATEX: :placement [H]
#+BEGIN_SRC sh :results output :dir ../sourcecodes
gcc foo.c -Wall -o foo
#+END_SRC

In this example, I use the dir header to change the directory for execution of the code.
When run in a terminal, this results to this:
foo.c: In function 'main':
foo.c:5:9: warning: unused variable 'i' [-Wunused-variable]
    5 |     int i=10;
      |         ^

This is what I would expect.
In emacs, it results to this:
#+RESULTS: qc:c-code-build

Whereas this
#+CAPTION: ...
#+NAME: qc:c-code-build
#+ATTR_LATEX: :placement [H]
#+BEGIN_SRC sh :results output :dir ../sourcecodes
ls
gcc --version
gcc foo.c -Wall -o foo
ls
#+END_SRC

returns that:
#+RESULTS: qc:c-code-build
: foo.c
: gcc (GCC) 9.3.0
: Copyright (C) 2019 Free Software Foundation, Inc.
: This is free software; see the source for copying conditions.  There is NO
: warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
:
: foo
: foo.c

Now, obviously this is not a real problem - just copy and paste the desired output into a src block your own.
I would just like to know if I'm missing something super obvious.
Other stuff I've tried/noticed:

Using shell instead of sh
results: output replace
:exports both
created a minimal example, which does not load anything from the template
tried to use scimax  (and failed, since by default it doesn't contain the org-babel-execute function for sh/shell)
some Buffer once gave me errors (Error Output or something)

Now, as promised, the reason:
Org-mode shell source blocks do not capture stderr
My solution for the problem:
I don't have a good solution for this as of yet. The solution of John Kitchin suggests use of 2>&1 which writes all stderr to stdout, for example:
#+BEGIN_SRC sh :results output replace :dir ../sourcecodes :exports both
gcc foo.c -Wall -o foo 2>&1
#+END_SRC

But that adds some unnecessary logic to the eye for the reader of the thesis, which is why I'm probably staying with copy-pasting stderr into src-blocks (except someone has a better solution)


texts: Emmet-mode: Wrapping individual lines in HTML tags

texts:
I'm new to Emacs, new to Emmet, and new to Stack Overflow.

I'm trying to wrap a list of text in individual html tags.

Home
About
Something

is supposed to become

Home

About

Something

Apparently emmet has an abbreviation for this. (Documented here: http://docs.emmet.io/actions/wrap-with-abbreviation/)

Following these instructions, I select my 3 lines of text, hit C-c w to bring up the emmet wrap function, enter ul>li* and hit RET. But instead of the expected

Home

About

Something

I get

I've tried experimenting with the $# placeholder but that didn't help.

Wraping a selected text in a single tag works fine (select text -> C-c w -> p -> RET to create a p-tag with the selected text in it). Creating multiple tags, each with the same text in it also works fine (select text -> C-c w -> ul>li*3 will create a ul with 3 items, each one has the selected text in it).

Supposedly the * operator (without a number) repeats something for each line highlighted, but that doesn't seem to work. Is this feature not available in Emacs' emmet-mode or am I doing something wrong?


texts: idiomatic way to lexically scope variables in a cl-loop body

texts:
Here is some asynchronous code in a cl-loop:

;;; foo.el ---                              -*- lexical-binding: t; -*-
(let ((my-list '(a b c)))
  (cl-loop for index below (length my-list)
           for value = (seq-elt my-list index)
           do (run-at-time 0 nil
                           (lambda () (message "index=%s,value=%s" index value)))))

This code prints "index=3,value=c" 3 times in the *Messages* buffer. This is not what I want. I would like to see "index=0,value=a", "index=1,value=b", "index=2,value=c" (I don't care about the order of messages).

A workaround is to let-bind the index and value variables:

;;; foo.el ---                              -*- lexical-binding: t; -*-
(let ((my-list '(a b c)))
  (cl-loop for index below (length my-list)
           for value = (seq-elt my-list index)
           do (let ((index index) (value value))
                (run-at-time 0 nil
                             (lambda () (message "index=%s,value=%s" index value))))))

This is good enough for me but I thought there might be a more elegant solution.

Another workaround is to pass #'message as third argument to run-at-time instead of the lambda and to pass the arguments to message as &rest arguments to run-at-time. This is not good enough for me though because my real code is a bit more complex and involves calling a callback variable which may or may not do a run-at-time.


texts:
I have the following in my .emacs.d/init.el, along the lines of what is suggested here:
(require 'importmagic)
(add-hook 'python-mode-hook 'importmagic-mode)
(define-key importmagic-mode-map (kbd "C-c C-l") 'importmagic-fix-symbol-at-point)
;; I want to bind to C-c C-l

I have installed importmagic and epc in my python environment.  And I have a .dir-locals.el that sets the environment and the importmagic-python-interpreter as suggested in the github:
((python-mode . (
                 (eval . (pyvenv-workon (concat (projectile-project-root) "envs/default")))
                 (eval . (pyvenv-activate (concat (projectile-project-root)  "envs/default")))
                 (eval .
                       (setq-local importmagic-python-interpreter (concat (projectile-project-root) "envs/default/bin/python"))
                       )

                 )
))

However, for example when I open up a python file like so:
y = os.path.dirname(__file__)

And place my cursor over os "C-c C-l" will either do nothing or maps to the default elpy python-shell-send-file
How can I make emacs recognize my keybinding?
My messages tab does say this:
For information about GNU Emacs and the GNU system, type C-h C-a.
Package cl is deprecated
(New file)
Importmagic and/or epc not found. importmagic.el will not be working.
Starting a new list of tags tables
user-error: No definitions found for: os

I'm additionally confused that the behavior sometimes seems to invoke import magic and fails, and other times summons an entirely different keymapping.  I'd expect deterministic behavior.


texts: prevent EMACS LaTeX mode from indenting pycode environment?

texts:
I'm using pythontex to allow me to embed Python code in LaTeX files. (It's really great, BTW.) I edit my LaTeX with EMACS. Unfortunately, EMACS thinks that any environment should be indented, and if I have indent within \begin{pytex}...\end{pytex}, it generates a Python error.

That is, EMACS thinks this is correct:

\begin{pycode}
   print("Hello World!")
\end{pycode}

But in fact, this is correct:

\begin{pycode}
print("Hello World!")
\end{pycode}

What do I put in Config-File to prevent the pycode environment from being indented?


texts:
I am  learning emacs-ledger. But I  am not getting how periodic transaction is added to ledger. I tried following method, but this does not have any effect on balance (? works for budgeting only). But as the same amount is deducted every month from the account, I need to automate it
Here is my transaction entry
~ monthly starting from February, 2021     ;loan transaction
expense:liability:loan   500
asset:checking           -500

Kindly let me know what is wrong? Your help is highly appreciated.
Regards


texts: Emacs doesn't display JPEG files correctly

texts:
PNG images displays well on my computer, but the JPEG images are displayed incorrectly as small boxes as shown in the following image:

I'm running Emacs 24.4 under Windows 7. And I compiled libpng16.dll and libjpeg-9.dll myself.

I got the PNG library from here and compiled it using Visual Studio 13. And I got the JPEG library from here and compiled it using MinGW.


texts: Why does eshell prefer lisp functions even when eshell-prefer-lisp-functions is nil?

texts:
If I startup emacs 24.5.2 with emacs -Q and do M-x eshell, then run:

$ which rm
eshell/rm is a compiled Lisp function in `em-unix.el'

I get the eshell version. But if I C-h v eshell-prefer-lisp-functions I see the value is nil. Yet the documentation states:

  If you would prefer to use the built-in commands instead of the external commands, set eshell-prefer-lisp-functions to t.

Is this a bug? I thought the docs might be backwards so I tried setting the variable to t, but the behavior stays the same, I continue getting the eshell implementation rather than the version in /bin.


texts: orgmode - adjust tikz picture width for beamer output

texts:
In this example, the first column width adjust works but the second column doesn't.
* topic
** column1
- first
- second
 :PROPERTIES:
   :BEAMER_col: 0.5
:BEAMER_env: block
   :END:
#+ATTR_LATEX: :width 0.4\textwidth
[[./circle.png]]

** column2
- first
- second
 :PROPERTIES:
   :BEAMER_col: 0.5
:BEAMER_env: block
   :END:
#+ATTR_LATEX: :width 0.4\textwidth
#+BEGIN_SRC latex :file circle.png :eval yes :results drawer :exports results
\begin{tikzpicture}
\def\r{2}
\draw (0,0) circle (\r);
\end{tikzpicture}
#+END_SRC

#+RESULTS:
:RESULTS:
[[file:circle.png]]
:END:

What's correct way to adjust the tikz output width to :width 0.4\textwidth?


texts:
I am having trouble getting the simplest Javascript source block in org-mode to run.

  #+begin_src js
    console.log("Hello");
  #+end_src

I always get this error:

/tmp/babel-8kqQwQ/js-script-shBzKH:1
require('sys').print(require('sys').inspect(function(){
               ^

TypeError: require(...).print is not a function
    at Object.<anonymous> (/tmp/babel-8kqQwQ/js-script-shBzKH:1:16)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

I am running on Spacemacs and did the configuration as described in the Org Wiki https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-js.html

OS is the latest Manjaro.
Emacs 26.3

The funny thing is, I am running my Emacs on my other machine with the exact same config. Same OS, same Emacs, same .spacemacs file. No issues.
I even did a fresh install of Spacemacs with the current config template on both systems. Same result. The desktop works, the notebook doesn't.

I can only imagine that an external JS runner is missing or broken?

I really don't know how to debug this.


texts:
Is there a way to get a quick help for a certain package? Something similar you get when you click package description in Paradox. I think it would be interesting a sort of doc package which get the list of your installed packages and fetch the Readmefile of the related Github pages. For example if you get the description of package, say Helm, using the describe-package command you get a very brief description:

helm is an installed package.

 Status: Installed in `~/.emacs.d/elpa/helm-20160824.745/' (unsigned).
Archive: n/a
Version: 20160824.745
Requires: emacs-24.3, async-1.9, popup-0.5.3, helm-core-2.0
Summary: Helm is an Emacs incremental and narrowing framework
Homepage: https://emacs-helm.github.io/helm/
Other versions: 20160824.745 (melpa), 2.0 (melpa-stable).

Instead it could be really useful to fetch the Readme and convert to an org file in order have a quick look for the most important commands.


texts:
I'm new to Org-Mode and Spacemacs and I'm trying to change the export style of org-mode. I want to take notes with it and have source code blocks.

I'm having difficulty in changing the export template. If possible, I would also like to know how can I import a .cls file in the same folder and use that as a template.

I have tried this three codes but it doesn't work:

#+LATEX_CLASS: org_mode_document_style: it cannot find the template
#+LATEX_HEADER: \documentclass{org_mode_document_style}: doesn't show
#+LATEX:\documentclass{org_mode_document_style}: doesn't show

So, I have this page in PDF and as you can see, some text is off the page, how can I correct this behavior? How can I transform the page on top in something like the page on the bottom?


texts:
For example, I can open a bare vim (without plugin) and input some_long_object and then hit Enter to open a new line, and input a s, hit C-x C-p, it will complete some_long_object for me. If I input some_long_object.some_method_really_long on a new line, then I open a new line and input s, then hit C-x C-p C-x C-p, it will complete some_long_object.some_method_really_long for me.

Vim can also do the same kind of thing on lines.(not only complete word, but also lines)

Out-of-box Emacs seems not doing word completion, line completion, and series completion as good as Vim. It only has an expand. when I use Vim, I can C-x C-p to complete a word, (maybe it is a some_object)and sequentially hit another C-x C-p to complete it, hoping to check what should be following a some_object, (for example it is a some_object.some_method), and C-x C-l will complete line or (use in sequence) lines for me.

So vim can complete one thing after another and I need not think about what should appear next if I am sure what should appear when I hit C-x C-p.

And another thing, I can use C-x C-p to recall what method I've used in this buffer but do not have to really finish the completion.

I heard of but have not used evil before. Can evil do the same thing as I just said? and can I use evil just for completion, not using its other kdbs? I've used to Emacs key bindings and have not used vim for at least 5 years.

I'm been using hippie-expand for years. I don't like the way it does things because it does not give me any feedback how I can use it. It's like exploring on a website without UE designing. I even tried hippie-expand with ido menu. It's just not what I need. I'm not familiar with auto-complete because when I tried it a few years ago, it was full of problems, and besides that its user experience was not as good as vim's completion. Vim's completion just provides me everything what I need and not any more or or any less.

So is there any Emacs extensions, or tweeks that can help me to do completion just like the way as I said?

I've been using Emacs for years. Emacs provides me many huge good things, but with this simple completion thing, I've tried again and again. Maybe the user experience philosophy behind Emacs is not so good as Vim.
For example, auto-complete claims it has built a LOW COST operation philosophy behind it. But for me, the simple thing is it uses a input-userlookup-feedback-input-userlookup-feedback loop in its philosophy. It is slower than vim, because vim use a input->not_good?->simple_adjust philosophy. Behind vim it is real Unix philosophy, which is splitting complex things to simple parts. Try to lower the feedback cost and decrease feedback-loop is the central thing what vim provide us.


texts: Emacs 27 Win 10 with WSL2 in org-mode, #+BEGIN_SRC bash, block appending \r newline character

texts:
Windows 10, now has WSL2, which enables one to use linux bash shell.
I have Ubuntu 20.04 installed as my default linux distribution in WSL.
What can I do to tell org-babel, in a src code block, what the newline should be?
The default newline seems to be \r which is causing problems in the shell.
See the attached screen shots showing the impact of me trying to run some bash commands, in EMACS, org-mode. EMACS is installed as a Windows binary.


texts: Why does vdiff not show differences between these two files?

texts:
Linux Mint 20, Emacs 27.2, vdiff -20210426.155
I create two files. And want to find difference in it.
M-x vdiff-files

Select file1.txt and file2.txt
Here result.

As you can see both files has different contents(last char in every row).
Why vdiff not show this differents?


texts: How can we use a specific command from LaTeX package while exporting to html?

texts:
I can add LaTeX equation in my org file using for instance.

\begin{equation}
x^2 + y^2 = z^2
\end{equation}

In this case when I export to html everything works fine. However, when I try to use a special command from a specific package for instance slashed command (\usepackage{slashed})

\begin{equation}
\slashed{p} + y^2 = z^2
\end{equation}

and export to html I can not see the output. How can I use specific commands from Latex packages while exporting to html?


texts: How to test if absolute path is a root file/directory

texts:
Q:  How to test whether an absolute path is a root file/directory (e.g., at the first level of the hard drive)?

I see a few possibilities depending upon whether the file is on Windows or Unix/Linux.  Here is my first attempt:

(equal "/bar" (concat (file-name-directory "/bar") (file-name-nondirectory "/bar")))


texts: Moving CLOCK entries from one header to another?

texts:
Suppose we have two entries: Header One and Header Two:

* Header One
:PROPERTIES:
:ID_LOG: TARGET
:END:
:LOGBOOK:
CLOCK: [2018-07-04 Wed 00:00]--[2018-07-04 Wed 0:30] =>  0:30
:END:

* Header Two
:PROPERTIES:
:ID: TARGET
:END:
:PROPERTIES:
CLOCK: [2018-07-04 Wed 00:00]--[2018-07-04 Wed 0:15] =>  0:15
:PROPERTIES:

Question: How can we copy all CLOCK entries from the former to the latter (via a command), so that the above example becomes the following:

* Header One
:PROPERTIES:
:ID_LOG: TARGET
:END:
:LOGBOOK:
CLOCK: [2018-07-04 Wed 00:00]--[2018-07-04 Wed 0:30] =>  0:30
:END:

* Header Two
:PROPERTIES:
:ID: TARGET
:END:
:LOGBOOK:
CLOCK: [2018-07-04 Wed 00:00]--[2018-07-04 Wed 0:30] =>  0:30
CLOCK: [2018-07-04 Wed 00:00]--[2018-07-04 Wed 0:15] =>  0:15
:END:

Notice that Header One has :ID_LOG: TARGET, and that Header Two has :ID: TARGET. This is meant to indicate the flow of how the time log data should be moved.

EDIT: The interactive function should be able to work across agenda files. That means it should search for ID_LOG headers in all agenda files and insert the found clocks at the corresponding ID headers in all agenda files.

It would be nice if it is additionally possible to search only the current headline for ID_LOG entries and to insert the found clocks at the corresponding ID headers in all agenda files.


texts: Where find good json formater and validation?

texts:
Emacs 26.1. Windows 10

It's has function json-pretty-print . But it not enough for me.
Has any another better json formater and validator?
I mean the next.

Suppose I has error on json on line 26. I missed ",".
But json-pretty-print get me strange error message:

Json readtable error: 93

I don't understand this message. What does it mean?
Why simple not get message something like this:

Error: Parse error on line 26:
...n1_FR"           }       ]   }   "loyalty": true,    "u
-------------------^
Expecting 'EOF', '}', ',', ']', got 'STRING'

So that is the reason why I need better json validator and formater.


texts: How to get a global available yasnippet snippet?

texts:
How to create a yasnippet snippet which is available in all modes?
Lets say I have a function which evaluates the sexpr before the cursor and replaces is with its value, Link to code.
Also I caught me to regular use following sexpr (format "0x%x" ${1:number}) which prints a number in hex. Converting this into a snippet is easy, but:

Question: How can I tell yasnippet, to make it available in every major-mode?

Note: I read the question about multiple modes, but this seems to be much work and fiddling and I would have to create a directory in snippets-dir for every possible mode.


texts: Certain org-mode buffers keep saving automatically

texts:
Certain org-mode buffers seem to write to file automatically when left idle even for a second. I've tried disabling a few minor modes but to no avail. It makes it all the more difficult to debug this since it only happens with a few org-mode buffers.

Version:

GNU Emacs 24.5.1 (x86_64-apple-darwin14.1.0, Carbon Version 157 AppKit 1344.72)

Enabled Minor modes in the buffer:

Async-Bytecomp-Package Auto-Composition Auto-Fill
Auto-Revert Blink-Cursor Company Delete-Selection Diff-Auto-Refine Disable-Mouse
File-Name-Shadow Flx-Ido Font-Lock Global-Auto-Revert Global-Company
Global-Font-Lock Global-Git-Commit Global-Prettify-Symbols Helm Ido-Everywhere
Ido-Vertical Line-Number Mac-Mouse-Wheel Magit-Auto-Revert Org-Bullets
Org-Indent Override-Global Recentf Shell-Dirtrack Show-Paren Smartparens
Smartparens-Global Tooltip Transient-Mark Window-Numbering Yas Yas-Global

My configuration is located at https://github.com/kirang89/.emacs.d.

I'd be really awesome if someone could help me out on this one. Thanks!


texts:
Occasionally when I'm navigating around I want Neotree to jump to the folder of the file I'm working in, but when I open Neotree it's still the last place I left it.  I can't find any function with M-x to jump to pwd.

Ideas?


texts: Key bindings are not recognized with non-Latin keyboard layouts on Ubuntu

texts:
A lot of times I have to change the input language of the keyboard (from English to a different one) causing the problem of the Emacs commands to not be recognized.

Normally when you press Ctrl+A you move to the beginning of the line. When I have a different language than English selected then it says "C-α undefined".

Is there a way to make them independent of the language selected? All editors support this by default so I am sure that there has to be a way.

I am using Ubuntu 16.04 and I installed Emacs through the terminal. It is the 24.5.1 version. I haven't configured the keyboard at all except having included one more language as a possible input.


texts: Get output of external command in the buffer

texts:
How do I get the output of (shell-command "df") (or some other more complex command, that I don't want to retype often) in the current buffer?

I run it by typing C-c p after it, but then it opens another buffer and sends the output there.


texts: More highly structured exports not working

texts:
Following this org export tutorial --
https://orgmode.org/worg/org-tutorials/org-latex-export.html --
I evaluated -- in an emacs -q instance --

(require 'ox-latex)
(unless (boundp 'org-latex-classes)
  (setq org-latex-classes nil))
(add-to-list 'org-latex-classes
             '("article"
               "\\documentclass{article}"
               ("\\section{%s}" . "\\section*{%s}")
               ("\\subsection{%s}" . "\\subsection*{%s}")
               ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
               ("\\paragraph{%s}" . "\\paragraph*{%s}")
               ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

and exported

* one
** two
*** three
**** four

but the last heading was still exported into an enumerate environment instead of into a paragraph.  What am I missing?


texts: How to show part of buffer in different buffer?

texts:
I have a buffer with some data. I want to select part of buffer and open the selection in different buffer (and window) to make it easier to read for me. Is there some function that does it?

I am looking for something like clone-indirect-buffer-other-window, but for selection, not a whole buffer.


texts:
The common use of Vim's quickfix is to hand off compilation of code to a command specified by the suggestively named makeprg variable and then interpret the errors printed by that command so you can quickly jump to the file, row, and column location of each error.

Vim's quickfix can be subverted and used in other ways but my question only concerns how to reproduce the above described behavior.

What Emacs feature is nearest to Vim's quickfix?


texts: How to know what chars are "word constituents" in latex-mode-syntax-table

texts:
In some of my query-replecements I need to have only alphabetic characters as word constituents in a local defined syntax-table. My approach is this:
(with-syntax-table
   (let ((my-syntax-table (make-syntax-table latex-mode-syntax-table)))
     (modify-syntax-entry '(48 . 57) "_" my-syntax-table)
 ;; "_" = symbol constituent
 ;; '(48 . 57) = 0, 1, 2 ... 9

     (set-syntax-table my-syntax-table)
     (perform-replace "\\w+" "word" t t nil 1 nil (point-min) (point-max))

     ))

How can find which other characters are word-constituents in latex-mode-syntax-table?
EDIT. I wrote this loop:
(setq CHAR 0)
(while (<= CHAR 255)
(when (string-match-p "119" (prin1-to-string (char-syntax CHAR)))
  (insert (char-to-string CHAR) "\s"))
(setq CHAR (1+ CHAR))

That returns (after setting latex-mode):
0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z                                 ¥ · À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ
So I was wondering if there is another way to set only the alphabetic characters instead of unset the other ones.


texts: Overriding preprocessor font-lock behavior in major mode derived from c-mode

texts:
I have a custom language that mostly follows C syntax, but uses (only) # for comments instead. I want to build a major mode with font locking for it. I've got it mostly working, by deriving from c-mode mutatis mutandis, except that evidently something in the bowels of c-mode I can't find is sometimes treating #word as a different face than a comment. I presume because it's programmed to treat it as a preprocessor directive, and indeed the first word is in the same face as a C preprocessor directive -- but subsequent words are correctly highlighted.
It's not entirely consistent: If I open a new buffer test.foo (setting the mode) and type # hello world or open an existing file with a block of similar comments at the top, they are correctly highlighted. But if in my new buffer I type   #now is the time on the second line, #now is in preprocessor face and the rest in comment face. It's also indented by two (after I hit  following the first line), which I don't want; that seems to be triggering the font lock, though when I load an existing buffer, some unindented lines beginning with # are wrongly font locked, too. If I go to a mis-locked line in the existing file, and edit it, it locks correctly, even if I move the cursor away, but if I reset the major mode, it mis-locks again. I can duplicate the line and reset the major mode, and one line mis-locks, the other is correct. (It's a little weird ...)
Also when I try to type a comma in the new buffer, it fails (!) and I get this error: c-syntactic-end-of-macro: Args out of range: #<buffer test.foo>, 0, 1. I do not get this error in the existing file.
I've pored over cc-mode.el but haven't been able to find the offending code, much less neutralize it. This is what I have so far:
(define-derived-mode foo-mode c-mode "Foo" "Major mode for Foo File"
  (modify-syntax-entry ?# "< ") ;; Set # as comment character
  (modify-syntax-entry ?\n "> ") ;; Set newline/return as comment end
  (modify-syntax-entry ?\r "> ")
  (modify-syntax-entry ?* ".") ;; Clear comment attribute of * and /
  (modify-syntax-entry ?/ ".")
  (setq comment-start "#")
  (setq comment-send "")
 )

Can anyone point me in the right direction?
Here is a sample file to play with:
# hello world
  #now is the time
  #for all good men
  # to come to the aid of their country
# now is the time
typedef ResultsType ResultsListType[1];
#Results - List -> DList ->SList
#Results - List -> DList ->SList
/* */
//

In this file, after saving, reloading, and setting the mode, #now, #for, # to, and only the first #Results are mis-locked.


texts: Is it possible to display DONE keywords in org-todo-list?

texts:
The documentation for org-todo-list states:

  Show all (not done) TODO entries from all agenda file in a single list.

By default, the function shows ALL items with a TODO keyword. Is it possible to show items with a DONE keyword as well?

I know it's possible to use 'N r' to select individual keywords to show, but I have multiple TODO and multiple DONE states and would like to view them all simultaneously.

A huge bonus would be the ability to show ALL TODO and all DONE keywords individually as well.

For reference, my keywords are:

(setq org-todo-keywords
   '(;; Sequence for TASKS
     (sequence "TODO(t@/!)" "WAITING(w@/!)" "DELEGATED(e@/!)" "|" "ASSIGNED(.@/!)" "CANCELLED(x@/!)" "DONE(d@/!)")

     ;; Sequence for POSSESSIONS
     (sequence "PURCHASE(p@/!)" "PURCHASED(j@/!)" "TRANSIT(u@/!)" "GIFT(h@/!)" "SELL(k@/!)" "LOANED(n@/!)" "|" "UNWANTED(a@/!)" "OWN(o@/!)" "GIFTED(g@/!)"  "SOLD(c@/!)" "DISCARDED(q@/!)")

     ;; Sequence for MULTIMEDIA
     (sequence "CONSUME(r@/!)" "SUBSCRIBE(b@/!)" "CONSUMING(l@/!)" "SHARE(s@/!)" "|" "IGNORED(i@/!)" "REFERENCE(f@/!)")

     ;; Sequence for EVENTS
     (sequence "VISIT(v@/!)" "|" "DIDNOTGO(z@/!)" "MEETING(m@/!)" "VISITED(y@/!)")))


texts: Rebind org-babel-execute-src-block-maybe to C-c C-c

texts:
In org mode, i can not use the Ctrl+c Ctrl+c
I have try to rebind it in my .emacs

(define-key org-mode-map (kbd "C-c C-c") 'org-babel-execute-src-block-maybe)

I have also try

(add-hook 'org-mode-hook
    (define (kbd "C-c C-c") 'org-babel-execute-src-block-maybe))

But when i hit the keys in a code block in org mode, nothing (the keybind is not bind to anything).

When i hit Alt+x org-babel-execute-src-block-maybe, everything works fine.

Thank you :)

EDIT:
All the Ctrl+c Ctrl+c are unbind in org-mode I simply would like to rebind it to its original function.


texts:
windows 10, emacs 26.1

I use ido mode.

in my init.el

(require 'ido)
(require 'ido-vertical-mode)
(ido-use-virtual-buffers t)
(ido-mode 1)
(ido-vertical-mode 1)
(setq ido-vertical-define-keys 'C-n-and-C-p-only)
(require 'recentf)
(recentf-mode t)
(setq recentf-max-menu-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)

And when I press C-x C-r it show buffer of recent files.
Something like this:

And after I press , e.g. 3 , Emacs open file d:/Personal/SPRINTS/sprint_174.org

Nice. It's work. But... it's very slow.
Has any more interactively and fast approach. I want to filter interactively (on fly) the names of recent files.
I want to do this is ido  mode. Something like in helm mode. But I don't like helm.

Is it possible?


texts: Mimic self-insert-command with insert/insert-char?

texts:
Due to various/extensive remappings I insert symbols with Control+key, for example Ctrl+9 inserts a left parenthesis (. This works fine with the remappings and the insert/insert-commands, however, modes such as smartparens do not catch this. In my example hitting Ctrl+9 with spartparens should insert a pair of parentheses () instead of a single one (which works using Shift+9). I suspect that the problem is due to using insert/insert-char instead of self-insert-command so the mode does not see/register the event. I wonder if anyone has any idea for a fix?

This my setup code for reference, essentially a loop over a macro that sets up a global keybinding for C-[unshifted char] to [corresponding shifted char]:

; Bind Ctrl as shift for symbols.
(defun my-bind-symbols-to-crtl ()
  (interactive)
  (let ( (chars (split-string
                 "~1234567890-=;']\\,./" ""))
         (shifted-chars (split-string
                         "`!@#$%^&*()_+:\"}|<>?" ""))
         (char "") (shifted-char "") )
    (while chars
      (setq char (pop chars))
      (setq shifted-char (pop shifted-chars))
      (when (> (length char) 0)
        (global-set-key (kbd (concat "C-" char)) (eval(macroexpand `(insert-key-macro ,shifted-char)))) ) )))

(defmacro insert-key-macro (in)
  `(lambda () (interactive) (insert ,in)))
(my-bind-symbols-to-crtl)
(global-set-key (kbd "H-[") (lambda () (interactive) (insert "{")))
(define-key input-decode-map (kbd "C-[") (kbd "H-["))


texts: What causes emacs to not display the mini-buffer or window while starting up?

texts: I am starting up emacs and I cannot see aynthing in the minibuffer or display window until it starts up.  Is there a reason for this?


texts: Evil surround repeat varying on varying width text possible?

texts:
I use viws" (visual select word surround with double quote) quite a lot then move up and hit . to repeat is there a way to modify dot so it does the exact command again.

currently if i do the above to surround a 4 character word it works i move up a line then hit dot on a 6 character word however it inserts the " as if its a 4 character word instead of surrounding the whole word.

Is this a limitation of using dot or something you can configure ?

also open to other options of surrounding strings like this quickly.


texts:
I am using Spacemacs and it always ask me to save .cache/abbrev_defs which is very annoying.

I tried to put (abbrev-mode -1) in dotspacemacs/user-config function. But it still ask for save the abbrev_defs file.


texts: I would like to learn Org Mode well by reading the whole org manual. However there seem to be only HTML version and PDF version which are not very convenient for me to take notes while reading. Is there an .org version of the manual or some way to produce an easily notable version?


texts: Find where advice is defined (defadvice)

texts: When a function documentation page tells me that a function has advice, is there any way to find out where that piece of advice is defined?  This is advice that was created using the defadvice facility.  I was eventually able to find it by grepping defadvice the-func-name in all lisp folders, but is there a more direct way to locate a given defadvice statement?


texts:
The emacsclient program allows a flag --no-wait (abbreviated as -n) which will cause the emacs server to visit the specified file, and return immediately.

emacsclient -n ~/.bashrc

If I provide an alternate editor, then this will still work in cases where there is no running Emacs server

emacsclient -n -a "/usr/local/bin/emacs" ~/.bashrc

However, this gives me inconsistent behavior because in cases where the server is running, this call will return right away.  In cases where there is no server running, and the alternate editor is used, the call becomes a blocking call, and will not return until I exit Emacs.

Is there a way to tell emacs (as opposed to emacsclient) to create a new frame and then return?


texts: find-grep-dired equivalents for ack and ag

texts: Is there an equivalent find-grep-dired using ack or ag? With the ability to specify the directory where the search starts? The Dired output itself is not so important (in fact I prefer the ack-mode result output). The closest thing I found is a Projectile ag/ack integration where the prefix argument prompts for the directory, but I was looking for something more general.


texts:
I'm following instructions on this page: https://orgmode.org/worg/org-tutorials/org-latex-preview.html. I have managed to install dvipng and successfully replicated the given example page as a .png file. Then, when I try to run org-latex-preview by C-c C-x C-l in Emacs, I get the following message:
Creating LaTeX previews in section... done.
However there no rendering happening anywhere. I'm running Emacs 26.3. on Ubuntu 20.04 LTS.
The value of org-preview-latex-default-process is dvipng and the value of org-preview-latex-process-alist is as follows:
Value:
((dvipng :programs
          ("latex" "dvipng")
          :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust
          (1.0 . 1.0)
          :latex-compiler
          ("latex -interaction nonstopmode -output-directory %o %f")
          :image-converter
          ("dvipng -D %D -T tight -o %O %f"))
 (dvisvgm :programs
           ("latex" "dvisvgm")
           :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "dvi" :image-output-type "svg" :image-size-adjust
           (1.7 . 1.5)
           :latex-compiler
           ("latex -interaction nonstopmode -output-directory %o %f")
           :image-converter
           ("dvisvgm %f -n -b min -c %S -o %O"))
 (imagemagick :programs
               ("latex" "convert")
               :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust
               (1.0 . 1.0)
               :latex-compiler
               ("pdflatex -interaction nonstopmode -output-directory %o %f")
               :image-converter
               ("convert -density %D -trim -antialias %f -quality 100 %O")))

The document I'm trying to render is the example given in the above link:
#+BEGIN_SRC latex :tangle latex/example.tex
\documentclass{article}

\begin{document}

\[
e^{i\pi} = -1
\]

\[
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\]

\end{document}

#+END_SRC

If I press C-u C-u C-c C-x C-l, I receive the same message Creating LaTeX previews in section... done. as above and once again no rendering.


texts:
When running this function:

M-x list-colors-display

I always get the following error:

Wrong number of arguments: #<subr max>, 0

If I try to use edebug in the function I get:

edebug-signal: Wrong number of arguments: #<subr max>, 0

The same happens starting emacs -q, I'm using: This is GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build 16G1408))
 of 2018-06-21

As pointed in the comments this was bug for the emacs that I installed with homebrew and --HEAD option. now with this version or < 26.1 works well:

This is GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.10 Version 10.14.1 (Build 18B75))
 of 2018-12-08


texts: Neovim inside of Emacs as an alternative to Evil mode

texts:
I'm a current Neovim user who happens to be interested in Emacs. I like Org mode, as well as some other features of Emacs. However, every time I've tried to use evil mode, it's felt crippled. (The Emacs side has been fine, however.) The reason for this, I believe, isn't that Evil is an imperfect vim implementation, but that I would never in a million years want to use stock vim for editing. I use lots of plugins for vim (35 at the moment), and most of them don't have an equivalent in Emacs that works fluidly inside of evil mode. I've tried spacemacs, and it's also not really satisfying. I believe, however, that there is a good solution to this problem:

Neovim, as a project, makes vim better-suited to be used as a component in an IDE. It can be run inside of other programs rather cleanly. Some examples of projects using this functionality are NyaoVim and ONI vim, as well as some projects which use Qt, Electron, etc. I would like to know if anyone has tried to run Neovim within Emacs, or if it's likely to gain some attention soon. It would be wonderful to have Neovim work inside of Emacs so that I could use Emacs as my development environment, then use standalone Neovim for other purposes, all with the same configuration and functionality.

Edit: (not sure if this should be in main post or a comment)

I now use spacemacs (emacs with a configuration that gives it better evil integration and makes it more useful out of the box), and have found that evil suits the vast majority of my needs, and I don't miss vim much if at all. One of the things I miss is the way that keybindings were handled. map, noremap, nmap, nnoremap, inoremap, etc. were all so easy to use and had their own syntax, true to the composable nature of vim's keybindings. However, the modes really are different in emacs. Transient states are great in spacemacs, so is the major/minor mode setup. I would still love to see the neovim team get their editor ("the future of vim") to lower the barrier of entry to arbitrary programs having vim keybindings by simply allowing programs to connect to a neovim backend. That would be great in my opinion. Evil really isn't vim, but it allows you to use most of vim with emacs. However, for now, Spacemacs is great, and offers the strength and ease of configuration of emacs.


texts:
I am experiencing some Emacs Tramp connection problems and want to ask for help. However in my case Emacs hangs completely because of Tramp and there is no way I can access Tramp debug files. (it is not responsive to Ctrl-g)
Is there a way to log those trace to a file?
PS I am aware of this question. However the answer accepted there completely ignores the request to log to a file and suggests to interrupt the process with Ctrl-g.
Thanks,


texts: Org mode elisp in :var in header-args causing max-specpdl-size error

texts:
In org mode, :var header arg definitions can actually call other SRC blocks, which is very nice! However I've run into a problem exemplified by the following org file:

#+NAME: add3
#+BEGIN_SRC elisp :var num=0
(+ 3 num)
#+END_SRC

* Use function drawer header arg
:PROPERTIES:
:header-args: :var n=add3(5)
:END:

#+NAME: whatIsN
#+BEGIN_SRC sh
echo $n
#+END_SRC

#+RESULTS: whatIsN
: 8

#+BEGIN_SRC sh :var a=whatIsN
echo $a
#+END_SRC

# !!!!ERROR!!!!: "variable binding depth exceeds max-specpdl-size"

This exact same example works fine if the :var for n is defined inline (instead of in the :PROPERTIES: drawer), like:

#+NAME: whatIsN
#+BEGIN_SRC sh :var n=add3(5)
echo $n
#+END_SRC

Anyone know what's causing org mode to stumble when the :var is defined in the :PROPERTIES: section?

org-version 9.1.11


texts: How to apply arithmetic operators to query-replace-regex

texts:
I am attempting to replace all "begin" and "dur" attribute values in my SVG code with one-tenth of (or ten times) their current values, in order to speed up/slow down animation for testing/debugging purposes.

e.g. replace dur="900s" with dur="90s"

My current regex: \(dur\|begin\)="\([0-9.]+\)s?"

and the replacement: \1="\,(/ \2 10)s"

I receive the error Error evaluating replacement expression: (wrong-type-argument number-or-marker-p #("900" 0 2 (rear-nonsticky display (fontified t face (nxml-attribute-value)) 2 3 (rear-nonsticky (display) fontified t face (nxml-attribute-value))))


texts:
I am a total emacs newbie and am trying to figure my way around emacs(I am kinda liking it).
Now my question is that when I type rails commands in my terminal, they work perfectly well.

user ~ $ rails -v
Rails 4.2.1

But when I run the same commands in eshell, I get:

Welcome to the Emacs shell

~/.emacs.d $ rails -v
rails: command not found

To my understanding, eshell is a shell within emacs. Right? Or I have it completely wrong?


texts: Binding the "Insert" key when running within a terminal

texts:
I accidentally hit the insert key so often that I put some code in my .emacs to disable the overwrite-mode key binding:

(define-key global-map [(insert)] nil)
(define-key global-map [(control insert)] 'overwrite-mode)

This works fine when using emacs within X. However, when I run emacs in the terminal (with -nw or over ssh), insert still turns on overwrite mode.

How can I bind insert in a terminal?


texts: Column view in org-mode custom agenda command

texts:
I am trying to define a custom agenda view that includes two agenda commands:

The first will list all unscheduled tasks with tag A (using standard view).
The second will list all scheduled tasks with tag A (using column view, one column of which is the SCHEDULED timestamp).

The following code (code v1) works but does not include column view for the second agenda command:

(setq org-agenda-custom-commands
  '(("c" "My Custom View"
    ((tags-todo "TAGA"
        ((org-agenda-overriding-header "Unscheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))))
     (tags-todo "TAGA"
        ((org-agenda-overriding-header "Scheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'notscheduled))))
 ))))

I am trying to implement org-agenda-view-columns-initially in the second agenda command (code v2):

(setq org-agenda-custom-commands
  '(("c" "My Custom View"
    ((tags-todo "TAGA"
        ((org-agenda-overriding-header "Unscheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))))
     (tags-todo "TAGA"
        ((org-agenda-overriding-header "Scheduled Tasks")
         (org-agenda-skip-function '(org-agenda-skip-entry-if 'notscheduled))
         (org-agenda-overriding-columns-format "%TODO %ITEM %SCHEDULED")
         (org-agenda-view-columns-initially t)))
 ))))

When I evaluate code v2 and then open the custom agenda view, I get the same result as code v1. However, when applied to a single, simple command as described on worg and by Carsten Dominik on the mailing list, the result is as desired. I am also able to get column view for both scheduled and unscheduled results using code v1 and C-c C-x C-c (org-columns) but this is not my ideal outcome (I only want column view for the scheduled tasks).

Is this incorrect implementation on my part, or a limitation of org-agenda-view-columns-initially? Thanks in advance.


texts:
I'm using emacs (technically: spacemacs with helm). It seems that any time I call a function which requires a directory, I am presented with something like the following:

The problem:

If I am in /a/path/to/a/directory but I want to get to /a/path/to/a/directory/that/has/a/deep/nested_file, I cannot just type nested_file and have it autocomplete. Instead I have to type each nested level of directories before I can get to nested_file.

Is there a way around this?


texts:
I'd like to prompt the user for a register name. Is there an easy way to do this? Apparently, this functionality isn't built into interactive (https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html)...

Thanks!


texts: What is the fastest way to move simple text to table in org mode?

texts:
Windows 10, Emacs 25.1.

Suppose I has the next text

OrganizationName    GUID

Advertisment    aaaaaaaa-14d7-4af5-ad10-ccccccc

Anelik  1c970d12-6c67-44e1-aa3f-bbbbbbbbb

I need to convert this text to table in org mode.
So result must be like this:

| OrganizationName | GUID                                 |
|------------------+--------------------------------------|
| Advertisment     | aaaaaaaa-14d7-4af5-ad10-ccccccc      |
| Anelik           | 1c970d12-6c67-44e1-aa3f-bbbbbbbbb    |

So I wan't do this line by line. Maybe has faster approach?


texts:
According to indent-tabs-mode,

  Indentation can insert tabs if this is non-nil.

nil means indentation cannot use tabs. I need the opposite of this option, prevent indentation from using spaces as tabs.

I need this to match a formatting convention (eclipse) where tabs are mandatory.

What is the simplest way to achieve this? I'm using plain java-mode, whose tab is bound to (c-indent-line-or-region &optional ARG REGION), which seems to use (symbol-function 'indent-according-to-mode), which eventually uses c-shift-line-indentation, but I don't see any options to configure using tabs only. Am I looking in the wrong place?


texts: Search file within neotree in an unexpanded directory

texts:
Is it possible to search a file in neotree which is deep inside some directory?
The normal search only searches in the visible parts i.e., within directories that have been expanded. I am looking for a feature where it would search within all directories and expand a directory if needed.
For example, consider the folder structure
A > B > C
A > D > C
where A, B, C, D are folder names. When I open neotree, suppose that B and D are folded. Now if I search for C, I would like the fold of B to be opened and the cursor to jump to C. If I hit next, it should open D and the cursor should jump to C within D.


texts: Text alignment in org-mode numbered lists?

texts:
Q: Is there a way to prepend zeros to org-mode numbered lists?

Text alignment in numbered lists starts to look unpleasant when numbers get into the double digits:

* A numbered list

  1. Item 1
  2. Item 2
  3. Item 3
  4. Item 4
  5. Item 5
  6. Item 6
  7. Item 7
  8. Item 8
  9. Item 9
  10. Item 10   # ah, my eyes!

The org-mode manual on plain lists states that:

  Items belonging to the same list must have the same indentation on the first line. In particular, if an ordered list reaches number ‘10.’, then the 2–digit numbers must be written left-aligned with the other numbers in the list. An item ends before the next line that is less or equally indented than its bullet/number.

So it looks like org-mode needs the digits to left-align.  As such, I'm wondering if it's possible to prepend zeros onto the single-digit items so that the text aligns nicely:

* A zero-padded numbered list

  01. Item 1
  02. Item 2
  03. Item 3
  04. Item 4
  05. Item 5
  06. Item 6
  07. Item 7
  08. Item 8
  09. Item 9
  10. Item 10   # much better!

Out of curiosity, I tried hand-entering the zeros in a list and hitting C-c C-c, which simply strips them out again.

So: is there any way to convince org-mode to prepend zeros in numbered lists?

(Note: question inspired by this S.O. thread.)


texts:
Emacs 26.2 M-C-L is bound to switch-to-next-buffer.  I have many files open but it's simply flopping between two.  On my old XEmacs the same key cycled through all of them (and S-M-C-L did so backwards).  I can't use that any more to find the exact function it was bound to.

Do I need a different function?  Or does this function need an argument?  (It seems to have no documentation.)

(To be clear: I have only one window open and it is not split in two.)


texts: Toolbar icons unable to load when running Emacs through xhost from FreeBSD to Ubuntu

texts:
I'm connected to a FreeBSD Computer using ssh [ip] -X, and emacs launches just fine, but this happens and all the icons are little pieces of paper with red X's:

> emacs

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'document-new' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'document-open' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'image-missing' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'window-close' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'document-save' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-undo' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-cut' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-copy' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-paste' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure

(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-find' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure

Does anyone know why this would be happening? GVIM loads just fine.


texts: find-file-hook when visiting file literally

texts:
I'm trying to hook into find-file-literally to turn off some global minor modes when visiting a file literally (which I usually do for large files).
However, it does not appear that find-file-hook is run when vising a file literally. The documentation does not mention this, so I'm wondering if this is expected behavior. In any case, what's another way to accomplish the above?
I'm using Emacs 27.1.


texts: create orgmode buffer without name in specific directory

texts: I want to create a function that creates a new orgmode buffer where I could type and at the end save in a predefined directory. If this is not possible, then create the buffer with a name in a directory, and after editing, be able to rename it.


texts: Magit - How do I sync my feature branch with the latest master without checking out master?

texts:
Here's what I am trying to do::

I have one project in one git repository. I've made some changes in master and created a spinoff branch (b s) called my-feature. Now I've finished my feature and would like to check it in. For checkin, I need to (fast-forward) merge my feature branch onto master and check in master. Normally I could do this with the awesome magit-merge-into (m i) feature). However by the time I am ready to push, master has changed, and I need to sync master with origin/master first before I merge my feature branch.

What is the best way to do this with Magit?

I'm guessing this is a common workflow for other developers as well. From the terminal I can do something like this from my feature branch to accomplish the above:

# On branch my-feature
git checkout master
git pull --rebase
git checkout -     # My feature branch
git rebase -       # master
# Verify changes
git checkout -     # master
git merge -        # my-feature
git push           # pushes master
git branch -d my-feature


texts: Shortcut or function to un- or de-emphasize without manual selection

texts:
The function org-emphasize puts formatting on a region, e. g. * at the beginning end end of a bold sentence or word.
To remove the bold attribute I can mark the same region, execute M-x org-emphasize and hit space.
Question: Is there a way to remove emphasis on a sentence without the need to mark the region?
Thoughts: Maybe it is possible to detect the next and previous emphasis marker and delete them. As an alternative: How would I mark the text between the next and previous emphasis marker in a function?


texts: How do I filter out CLOSED items older than a certain age on export

texts: I've been trying to figure out how to filter out older CLOSED items when exporting by org tasks. I thought I should be able to use org-export-get-date with information from the communications channel in a :filter-headline filter but I haven't been able to get it to work. It's not helped by the comms channel structure being so massive you can't print it out without hanging ielm. Do I just need to extract the the start and end bounds of the entry and furtle around for the closed tag myself?


texts:
When I quit Emacs, nothing is saved, such as my search history, my command history, my replace strings, etc.

I want EVERYTHING saved.  How do I do that?

And by everything, I mean at least the following;

Cursor, I mean, point :) position in each file Undo history for each
file
Command history. This is tricky to specify because unlike in the
other editor, commands are issued in various ways. C-x, etc. M-x,
etc.
Search and replace history

It should feel as if I never exited the session.

I do not even know where to look for.  Google shows me some scary cryptic functions, etc. And talks about packages, etc.

Is there an easy, newbie friendly way out?


texts: Is there a way to merge two branches interactively line by line in magit

texts: How can I merge two branches with magit interactively line by line. Important there is no conflict (well ONLY for git it isn't) but I still want to do this.


texts: cycle between headline levels in org mode?

texts:
I find that I would like to expose different levels of detail in my org mode buffers; especially while reviewing possbile next steps across many projects.

org-shifttab comes close.  It will cycle from fully folded to expanding all of the headlines.

I would like to add the ability to cycle through the visibility of headlines at level 1, then at 1 and 2, then at 1, 2 and 3... you get the idea.