texts: Hierarchical org refile support with ivy

texts:
When I enable ivy-mode in an org buffer and C-c C-w for refile, all headlines are presented as refile targets. So far so good. I relied on the org default setting (org-outline-path-complete-in-steps 't) which presents me a hierarchical possibility to complete the refile target.

I have 377 headings in my org files, of which 7 are top level headings (nesting level 1, one star *)

I wonder if there is a method to somehow emulate hierarchical completion with ivy?

What I am looking for is, besides of regex completion / search in ivys completion narrowing, ivy support to "cycle" through the hierarchies of the heading nesting level I am currently at.


texts: Can xref-find-definitions jump into packages in venv?

texts:
I have following Python file and my cursor is on top of os, or sys, or pprint. When I do xref-find-definitions it does not jump into their definition that is I belive location on the ~/venv file. Is it possible to accomplish it using xref?
Please note that it can jump into functions that are defined in my repo.
#!/usr/bin/env python3

import os
import sys
from pprint import pprint
from my_function import my_function  # it can jump into my_function


texts: Emacs (-nw) version 24.4.1 adds escape code to the top of every file, when 24.3.1 doesn't

texts:
When I run 'emacs -nw --no-init abc' with emacs version 24.4.1, I always see the same escape codes inserted at the top of the file:  "12;rgb:0000/0000/0000".  When I run the same command on the same machine with emacs version 24.3.1 I don't see those escape codes. Has something changed that I need to adapt to or is this an emacs bug?  This is on RedHat 5.8.  TERM is set to xterm.

Both versions were installed by recompiling from source.  This also happens with emacs version 24.5.1.


texts:
During research, I often cite a passage from some website, a local document or org file. For context and later use, I always add the source reference after the block:

* Public transport
** Bus

Buses are used a lot:

#+BEGIN_QUOTE
The urban bus system, the world's most common form of public transport, uses a network of scheduled routes to move people through the city, alongside cars, on the roads.
#+END_QUOTE
Source: https://en.wikipedia.org/wiki/City#Transportation

I would really like the referenced source to be an actual property of the block. I don't know if there is a way for that, or in which direction I should look for this. I've tried looking at header arguments and org-ref, but they do not seem really applicable to my specific requirement.

Is there a standardized or recommended way of annotating org blocks with source references?


texts:
Q: What is the simplest way to insert text without moving the cursor?

Is there a command, say insert-right-of-point, that does just that already? I did not find one and gave up after several C-h a.

My best solution at the moment is to define the command with some (save-excursion (apply 'insert args)) but there are probably better ways (better = faster, or more robust, or more elegant, or ... Have your pick).

PS. For people who ask "what do you need that for?!": I have a program that insert things in a buffer but the natural way of computing what to insert produces several bits of text in succession, and it produces the last bits first.


texts: I would like to couple two autoloaded functions, while using use-package

texts:
I would like to couple elm-format-on-save-mode and elm-preview-main, so that when I save a file it gets formatted and compiled, and the generated html get's previewed.
(use-package elm-mode
  :config
  (elm-format-on-save-mode 1)
  (defun format-preview ()
    (require elm-format-on-save-mode)
    (require elm-preview-main)
    (when (eval-expression elm-format-on-save)
      (eval-expression elm-preview-main)))
  (add-hook 'elm-format-on-save-mode 'format-preview))

As it is, elm-format-on-save-mode is not activated automatically when I enter an .elm file. And it's not coupled to elm-preview. How can I fix these problems?


texts: What techniques or functions can help manage hundreds of buffers?

texts:
After several months of work, my Emacs easily accumulates 400 or 500 buffers.  This makes restoring from desktop-mode irritatingly slow.  I'd love to be able to delete buffers in bulk, ideally from the buffer list.  For example, "mark for deletion every buffer associated with a file whose name matches regexp" or similar.  But I can't find such a function, and looking at the way the buffer list is implemented, I can't figure out how to write one myself.
What functions or techniques exist for managing a large number of buffers?


texts: How can I paste paragraph not to interrupt numbers in list org mode?

texts:
In list environment, after I copy several paragraphs, the next  item number will change into number 1, How can I
deal with that?

For example,

1. aaa
2. aaa
3. aaa
bbb    <---this is what I copied
ccc
1. aaa <---I want it becomes 4


texts: Tramp `find-dired`: wrong type argument error

texts:
If i use find-dired in a remote directory (from Tramp) then I get a wrong type argument: processp, nil error.

It works on a local dir.

All I pass to find is '-iname "blah"'.

/sftp:andreaz@10.0.0.99:/home/andreaz/files/:

find . \( -name "*blah*" \) -exec ls -ld \{\} \;


texts:
I have used a package before which used the header line to show the name of the current function being edited.  Whatever package it was, I don't have it installed now.  What are my options for getting this sort of functionality?

How can I have a persistent view (e.g. mode-line, header-line, etc.) of the current function being edited when the top of the function is past the top of the window?


texts: mu4e-compose-dont-reply-to-self and address completion breaks on emacs exit

texts:
My configuration seems correct, since I got it working for a week or so.
But after I quit spacemacs (using SPC q q), it stops working.

More details on reddit

Is there any specific order required for mu4e-compose-dont-reply-to-self to work reliably all the time ? When it doesn't work, it is frustrating. So I would like fix that first.

Similarly, What configuration is required to see auto-completion for the addresses ? I haven't consciously configured anything. May be it "somehow" works. But I would like that to work always.

Edit dated Aug 17, 2017

It seems both these issues may be related to some "cleanup" not happening when mu or 'mu4e` exits (indirectly when emacs/spacemacs exits)

I noticed one more "bug" - my mu4e alerts were also "working", they have also stopped.


texts: How to set `evil-insert-state-cursor` to a function?

texts:
In evil-mode, the cursor shape and colour for each state is controlled by the series of variables evil-*-state-cursor. The documentation for these variables states:

  May be a cursor type as per cursor-type, a color string as passed
  to set-cursor-color, a zero-argument function for changing the
  cursor, or a list of the above.

However, when I attempt to use such a nullary function to make the shape of evil-insert-state-cursor dependent on the value of overwrite-mode, it doesn't work:

(setq evil-insert-state-cursor
      (lambda()
        (cond (overwrite-mode '("chartreuse3" (hbar . 2)))
              (t              '("chartreuse3" (bar  . 2))))))

The result of this is that the insert cursor changes to a hollow box in the same colour as the normal state cursor (Darkgoldenrod2 on my system). If I use a named function instead, I get a solid box (ie. identical to the normal state cursor).

I've also attempted to use a function that actually sets the value of evil-insert-state-cursor, rather than simply returning it. The result was the same. In general, setting the variable to any function results in a solid cursor, while setting it to any symbol/quoted sexp or lambda results in a hollow cursor.

How can I set a state-cursor variable to a function effectively?

(I've found the answer to this before posting, but since I've already written the question, I might as well post it with the answer in case anyone else is searching for it.)


texts: why is emacs indenting when I type an open paren

texts:
I'm very new to Emacs and I like it so far, but there is one thing that has been bugging me. Its auto-indenting has been acting pretty random.

Whenever I am on a new line and type something like:

for (

it indents one deeper than the deepest indent level (syntax error). This is happening in python-mode and c-mode, but not in text-mode. Why is this happening and how do I fix it?


texts: Org-mode as a Get-Things-Done (GTD) system

texts:
I use Org-mode as a structured notebook. I find it convenient to store information I want to keep using the directory/tree paradigm, when the notes I want to keep are too short to need a file.
I would now exploit my familiarity with Org and turn it in a Get-Things-Done (GTD) system.
While there is a specific section on Worg on GTD, it seems often  outdated.
Older articles (2009,
2007) mention integration of Org with remember-mode for the implementation of GTD.  They mention a number of elisp variables/functions, e.g. org-remember-store-without-prompt, org-remember-templates and features such as "remember templates", which I am unable to find.
The Remember Mode entry in the Emacs wiki seems to clarify a bit:

Now that OrgMode and RememberMode are included in Emacs (as of Emacs 23), activation is as simple as: (org-remember-insinuate)
Note that there is no need for: (require 'remember)

but again I do not find (org-remember-insinuate).
Someone mentions  yet another package, (require 'org-remember), and still I have no such a library.
I am confused, to say the least. Outdated GTD guides on Worg might still be (conceptually) useful, but I need to have clear the following points.

Is Remember mode still needed by Org? Or is its functionality entirely covered by Org?
More specifically, is org-capture the Org alternative to Remember mode?


texts: Getting `:distant-foreground` face attribute to work

texts:
Emacs's faces let you set :distant-foreground, which according to the docs, "is like :foreground but the color is only used as a foreground when the background color is near to the foreground that would have been used."

I'm not really sure how "near" is computed, but it doesn't seem to be good enough. I would like to use it with my region face, so that the text is in the same face it's normally in, except when it's unreadable. My region is currently set to :background "lightgoldenrod2". Selecting some white text with this makes it unreadable. When I set :distant-foreground "black", it doesn't change.

How is "near" calculated here? How can I adjust this calculation to be a more reasonable contrast calculation?


texts:
I have been enjoying Xah Fly Keys by @XahLee and I am trying to create my own keymap for some org-mode functions.  I have read the helpful documentation.  I used this section as a template for my keymap:
Add or Change Leader Key Sequence - Here's a example of creating a whole keymap

When I start emacs I get this error massage.

Warning (initialization): An error occurred while loading `/root/.emacs':
Symbol's value as variable is void: xah-fly-leader-keymap

This is the part of my .emacs where I am trying to create the keymap.

(setq my-org-mode-keymap (make-sparse-keymap))
(define-key my-org-mode-keymap (kbd "o") 'org-meta-return)
(define-key my-org-mode-keymap (kbd "c") 'org-metaup)
(define-key my-org-mode-keymap (kbd "t") 'org-metadown)
(define-key my-org-mode-keymap (kbd "h") 'org-demote-subtree)
(define-key my-org-mode-keymap (kbd "n") 'org-promote-subtree)
(define-key my-org-mode-keymap (kbd "g") 'org-shiftright)

(define-key xah-fly-leader-key-map (kbd "o") my-org-mode-keymap)


texts: How to use phpactor.el in GNU Emacs 25.2.2

texts:
I am a Vim user for about a year now and I am curious to give Emacs a try. I discover Emacs for some days now and I would like to improve my PHP-editing experience.
In Vim there is a plugin for phpactor, a smart autocompletion tool for PHP, as it's done in IDE.
There is also an Emacs plugin (in alpha version as of writing), and I can't get it to work.

To install Phpactor I followed the documentation, so I have a global phpactor command that I can use.
As an example here is the output when I run it in my Terminal:

$ phpactor status
Version: 7db7a5c (3 weeks ago) updated-composer-749
Filesystems: git, simple, composer
Working directory: /var/www/html/work/libs/myrepo

Config files (missing is not bad):

  ✘ /home/john/.config/phpactor/phpactor.json
  ✘ /home/john/config/phpactor/phpactor.yml
  ✘ /var/www/html/work/libs/myrepo/.phpactor.json
  ✘ /var/www/html/work/libs/myrepo/.phpactor.yml

Diagnostics:

  ✔ Composer detected - faster class location and more features!
  ✔ Git detected - enables faster refactorings in your repository scope!
  ✔ XDebug is disabled. XDebug has a negative effect on performance.

By viewing so, I think it's installed successfully.
In Emacs I installed the plugin by using the command package-install phpactor.
My ~/.emacs contains the following as suggested by the plugin documentation:

(add-hook 'php-mode-hook
          (lambda ()
            (make-local-variable 'eldoc-documentation-function)
            (setq eldoc-documentation-function
                  'phpactor-hover)))

Now that everything is installed I would like to use it and I don't know how to. I think phpactor is called when I am about to call a method on a variable, but I only see an error in the mini buffer. Here is an example:

function thing() {
    $a = new Stuff();
    $a->|
    return 1;
}

When my cursor is just after the arrow (where I put a pipe |), I see the following in the mini buffer:

Phpactor: Unknown item "return", known items: "return", "return", "return"

In Vim I only need to install the plugin and type C-x C-o to have a context menu with the suggested method names.
How to use it in Emacs?


texts: quickly kill and then yank parts of a program

texts:
I very often encounter the problem that I have to cut out a part of an expression and need to copy it somerhere else. For example the following python line:

courtage_text = data["expose"]["brokerage"]["courtage"]["text"].lower()

What I want to do is cut out

data["expose"]["brokerage"]["courtage"]["text"]

What I do very often is to move the point to the beginning of what I want to cut out and then do M-f a couple times to move where I want and then C-w

Is there a faster way of selecting what I want? I think this is a common problem and relevant to other languages as well.


texts: `C-c C-e l o` does not open the pdf anymore

texts:
After upgrading to Emacs 27, I noticed that, for any org document, C-c C-e l o now behaves on my computer as C-c C-e l p: i.e., the pdf is correctly produced, but is not displayed anymore on side window.
Even when opening the document with emacs -q, I have the same behavior, so I guess that the problem is not related to my init file. (However, all my pdfs used to be displayed in Emacs with pdf-tools and not with the standard doc-view: don't know if this may be part of the problem.)
Anyway, when I run a C-c C-e l o on a file essai.org, I have the following output in the *Messages* buffer:
Processing LaTeX file essai.tex...
PDF file produced.
Running /usr/bin/xdg-open /home/fs/Documents/essai.pdf...done

but no buffer is created and displayed within Emacs for the pdf output. I have no clue for that problem...
Thanks!


texts: How to test for specific Emacs version or newer?

texts:
Emacs 24.4 made an incompatible change to interpreter-mode-alist, treating its members now as regular expressions and no longer as simple strings (http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1af4c2203ce7954c089133234ba80e6272ce9458).  I want to replace:

(add-to-list 'interpreter-mode-alist
             ;; Match php, php-3, php5, php7, php5.5, php-7.0.1, etc.
             (cons "php\\(?:-?[3457]\\(?:\\.[0-9]+\\)*\\)?" 'php-mode))

(which works fine with Emacs 24.4 and newer) with compatibility code that, depending on the version of Emacs, adds either a regular expression or strings.

What is the preferred way to test if the Emacs version in use is 24.4 or newer?  (if (version< emacs-version "24.4") …)?


texts: How to make everything except the text transparent?


texts:
Imagine I want to create a list with 10 items, i. e.

1.
2.
3.
...
10.

In Vim I can use the command :for i in range(1,10) | put =i.'. ' | endfor for this.

How can I do the same thing in Emacs?

Evil mode does not seem to support it because I get the error message Unknown command: 'for'


texts: Clear secondary selection without using mouse

texts:
Occasionally, without meaning to I somehow mash keys or mouse so that I get a secondary selection.  I never use the secondary selection so I would always like to get rid of it.

How can I clear the secondary selection without using the mouse?

The default bindings for setting the secondary selection are intercepted by my window manager, so do not work in emacs.  I don't really want to rebind these commands to other mouse events either: I use my mouse just for a few things, they work fine and I don't want to change them.  I can't simply run commands like mouse-start-secondary: when I try that, emacs lets me know they have to be bound to an event.


texts: Imitate paragraph spacing in visual line mode

texts:
I write long texts using org-mode and visual-line-mode. Each long line, wrapping over several visual lines, looks like a "paragraph", and behaves similarly to a paragraph in a traditional word processor.

I would like to see some extra spacing between such "paragraphs", that is, between lines, but not between visual lines within the wrapped long line. ((setq line-spacing 0.5) is obviously not it.)

Is this achievable in a GUI version of Emacs? I use the build from https://emacsformacosx.com/, but would consider switching to a different build.


texts: ido-find-file and dropping into directory

texts:
Reading the documentation for ido-find-file it says pressing C-d will open the specified directory in dired.

However I can't get this to work no matter what text I leave in the minibuffer, could someone explain how to get this working please?

On Windows x64, Emacs 25.0.50.1

(Update: works on 24.3.1 on BSD)


texts: Is there a way to view summaries of multiple repositories

texts:
I'm using a small script like

for d in $HOME/Repository/* ; do
   if [[ -n "$(git -C $d status -s)" ]] ; then
        emacsclient --eval "(magit-status $d)"
   fi
done

to open repositories that need intervention. But I would like to see this info in a buffer in Emacs, preferably a summary of multiple repositories to show which files need merge/commit along with incoming/outgoing info.

Is there a package/configuration for this?


texts: How to define mode-specific keys in evil-mode?

texts:
I want keybinding X to do one thing in c-mode and another thing in other modes.  I'm trying to figure out how to do this in evil, specifically evil's insert-state.

I tried setting the keybinding in a mode hook:

(add-hook 'c-mode-hook (lambda ()
                         (define-key evil-insert-state-map (kbd "RET")
                           'c-indent-new-comment-line)))

And left everything else defined in my init file as:

(define-key evil-insert-state-map (kbd "RET") 'comment-indent-new-line)

But the problem is that the hook does not seem to override my default keybinding.  How do I override a key binding in evil based on a mode?


texts: How to get Emacs to automatically open a specific directory on startup?

texts: I would like Emacs to open the folder $HOME/Documents/CodeLite/CPP-Math-Projects/Simple-Pendulum on startup and show it in the directory browser. Is there a way to do this? I have read https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html, but it is too abstract for me to follow, given the fact I am fairly unconfident with Emacs Lisp.


texts: open org-agenda weekly view window when emacs is loaded

texts:
I understand that find-file "file path" in .emacs can load the file automatically after emacs starts up.
However, I would like to haveorg-agenda week C-c a a open instead of a local file.
How can this be achieved by elisp?


texts:
Org-mode keymapping defaults to using the arrow keys for commons functions.  Has anyone sanely remapped their org-mode settings to entirely avoid arrow keys?

Please share.


texts: configure packages without`provide` with `use-package`

texts:
How to configure packages, which have no (provide <PACKAGENAME>) call in their source code?

Immediate problem: configure isearch with use-package.
(Editing isearch.el is not an option because it may break updates and may trigger heavy bug hunting)

Edit: answering Drews comment: use-package can be used to cluster elisp code, which should belong to a package/library. The user is then able to write functions or set up keybindings, which are part of a users emacs configuration. Whith this technique it is possible to lazy load self written functions, or even redefine functions from a package after the package/library has been loaded. (Of course there are also other ways to do that but use-package is a nice Domain Specific Language for that kind of configuration).
By "configure" I mean writing a valid use-package sexp which serves the purpose of changing emacs default behavior.
Yes, with "Editing" I meant changing the source code file isearch.el. Emacs is hackable after all.


texts: Avoid Adding Backslash to Curly Brackets when Exporting Latex

texts:
I want to export an org tree to latex, but whenever I have a command that nests curly brackets, org export will automatically prepend all brackets with a backslash.

For example, the tree:

Exports to (C-c C-e C-s l l):

Instead of:

Question: How do I export the literal latex command I typed without having org-export prepend backslashes as in the example above?


texts: Why do I have two completions when editing python file?

texts:
As in the picture, when I editing python file, there are two completions. Why is that? Thank you very much.

Following are my init.el related to elpy and completion:

(elpy-enable)
;;(setq elpy-rpc-backend "jedi")
;;(autoload 'jedi:setup "jedi" nil t)
;;(add-hook 'python-mode-hook 'jedi:setup)
;;(setq jedi:complete-on-dot t)                 ; optional
(elpy-use-ipython)
(global-eldoc-mode -1)

(add-hook 'after-init-hook 'global-company-mode)
;;(defun my/python-mode-hook ()
 ;; (add-to-list 'company-backends 'company-jedi))
;;(add-hook 'python-mode-hook 'my/python-mode-hook)


texts: EPA (EasyPG Assistant): How to select which private key to use when encrypting?

texts:
How does 'epa-encrypt' decide which private key to use? If I have two private keys, and I've only shared one of my public keys with the recipient, and I encrypt with epa-encrypt-region and select the recipient's public key, which one of my private keys will be used to encrypt?

For example, when I execute epa-encrypt-region, I get the following menu to choose which public key to encrypt with:

Select recipients for encryption.
If no one is selected, symmetric encryption will be performed.
- `M-x epa-mark-key' to mark a key on the line
- `M-x epa-unmark-key' to unmark a key on the line
[Cancel][OK]

  u 372XXXXX Joe Blow <joe@blow.org>
  u 1F0XXXXX Joe Blow <joe.blow@gmail.com>
  - 7F2XXXXX Jane Doe <jane@archlinux.org>
  - A4DXXXXX John Doe <john@doe.com>

and I am Joe Blow with two private keys, and I want to send a message to Jane Doe, who only has my gmail public key. Thus, I need to encrypt with my gmail private key. How do I know if epa-encrypt is using the right private key for encryption?

Or does 'epa-encrypt' or the key-ring auto-magically know if the recipient has my public key?


texts: Company mode won't autocomplete variables with underscores

texts:
I have web-mode and company installed but company just seems to autocomplete the variables without underscores:
With Emacs Lisp Mode

With Web-mode

;; --- Company ---
;; Autocomplete with dropdown system

(use-package company
  :ensure t

  :init

  :config
  (setq company-dabbrev-ignore-case t)
  (setq company-dabbrev-downcase nil)

  (setq company-idle-delay 0.2)
  (setq company-echo-delay 0)
  (setq company-minimum-prefix-length 2)
  (setq company-tooltip-minimum-width 110)

  (setq company-dabbrev-code-everywhere t)
  (setq company-dabbrev-code-modes t)
  (setq company-tooltip-align-annotations t)
  (setq company-selection-wrap-around t)

  (setq company-transformers '(company-sort-by-occurrence
                           company-sort-by-backend-importance))

  ;; (define-key global-map (kbd "C-.") 'company-files)

  (add-hook 'after-init-hook 'global-company-mode)

  (setq company-backends
        '((company-files
           company-yasnippet
           company-dabbrev
           company-keywords
           company-capf
           company-php
           )))

  )


texts: AUCTeX LaTeX-math-mode outside a mathematical environment

texts:
Using AUCTeX with LaTeX-math-mode enabled, if I type (say) ` a inside a mathematical environment, it inserts \alpha, as I want. But if I do it outside a mathematical environment, it inserts \alpha{}.
A minor point of curiosity is why it does this? I can't imagine why I would want this.
But my main question:
I would much prefer it to insert $\alpha$, or \(\alpha\) if you prefer.
Is there an easy way to make it do this? Preferably one that doesn't involve going through all the Greek letters one by one. Or is there some reason why I shouldn't really want this?
I know that C-u ` a will do what I want, but I wondered whether there is some way of dispensing with the C-u since I have no use for the default behaviour of ` a.


texts: How to check for network activity coming explicitly from/inside of Emacs

texts:
I'm not an expert in Elisp, but to settle my own privacy concern, I'm interested in ways to monitor network activity explicitly done inside of Emacs:

Background:

I'm used to installing different extensions, and i don't feel like actually auditing the new commits done on Emacs (I auto compile latest Emacs all the time), or even spend time understanding every part of an Emacs extension.
I'm also already aware of setting up gnutls correctly...and other basic configuration.

Why:

Why? Because others tools i tried fail to correctly report certain information, which would greatly help in knowing what does what. Example:

Example tool, Nethogs:

When using this tool, let's say when I'm doing update on certain extension, i only see the ip of where they are downloaded, and while i can inspect packets with tcp/etc, i don't know it is actually coming from Emacs, (except in this specific case where i know I'm the one updating manually + I already know the ips used by those update).
It basically work fine for certain application like firefox where it successfully show that X amount of network activity is coming from said application. But not for Emacs...
Any way to monitor network activity, specifically of Emacs (ergo, anything inside of it) with decent details (made in Elisp if possible)?


texts:
I have an org file with R code in it. When I attempt to export to html or pdf I get an error:

For example if my file was:

#+begin_src R :exports code
square <- function(x)
{
 x * x
}

square(1:10)
#+end_src

I type: C-c C-e h o the mini buffer says: Symbol’s value as variable is void: backend


texts: Sending code to an ansi-term via isend-mode: How to modify default buffer chosen and how to automatically open ansi-terms?

texts:
I use isend-mode (see here)
to send (bash) code to an ansi-term as follows:

1) `M-x ansi-term` # open ansi-term
2) Open buffer with code I want to send to *ansi-term*
3) `M-x isend RET *ansi-term* RET` # => associates code buffer with `*ansi-term*`

Then you can step through code with C-RET and see the output in ansi-term.
There are two things that are tedious:

On M-x isend RET, the current buffer name is suggested as output where
to send the code to, but I never do that. I would like to have *ansi-term*
as default there. This should be rather easy given the definition of
isend-associate (see the above link, line 262), but I'm not an Elisp
programmer (is it simply (setq isend--command-buffer *ansi-term*)?)
Ideally, M-x ansi-term in Step 1) would not be necessary. It would be great
if calling M-x isend RET *ansi-term* would automatically open a new
ansi-term (unless there's already one open in which case it should go to that)
and associate it with the code buffer.
Out of interest, is there any other method that can send code from a buffer
(.sh file) to an ansi-term (or even 'real' terminal provided by the OS) so
that you can step through the code one line at a time or send regions?
I didn't find any other ones but isend-mode.


texts: Is there a lightweight Java environment for EMACS? I have used JDEE in the past, but it's accumulated a lot of, ahem, features since I used it last, and just trying to set it up has consumed a couple hours.


texts: How to navigate inside helm (helm-mini in this case) vertically with arrow keys? I mean, I wanna go to Recentf "submenu" (like on picture), but pressing down arrow keep iterating over Buffers. I found a way to use PageUp/PageDown, but this is quite inconvenient. What am I missing?


texts: How can I nest one syntax table in another?

texts:
I've written a simple mode for handling JSON. It uses the derived machinery to re-use most of json-mode's code. However one addition is you can insert elisp into the JSON text which is evaluated at JSON submission time. For example an excerpt of the json looks like this:

{
    "parameters": {
        "IRC_USER": "stsquad",
        "PUB_KEY": `(format "\"%s\"" (s-trim (shell-command-to-string "cat ~/.ssh/id_rsa.pub")))`
    }
}

Currently the syntax highlighting of this text is broken as the JSON syntax hightlighter get's thrown by the elisp. I'd like to set-up a nested syntax table so the elisp is properly recognised as elisp when inside the escape characters (I've chosen ` in this case). I understand you can join char-tables (which syntax-tables are built from) with something like:

(defvar lava-mode-syntax-table
  (let ((json-table (copy-syntax-table json-mode-syntax-table))
        (elisp-table (copy-syntax-table lisp-mode-syntax-table)))
    (set-char-table-parent elisp-table json-table)
    (modify-syntax-entry ?` "(`" json-table)
    (modify-syntax-entry ?` ")`" json-table)
    json-table)
  "LAVA Mode syntax table.
This is a combination of json-mode-syntax-table with an escape into
  lisp-mode-syntax table for the embedded elisp.")

But I don't understand how I can modify the syntax table to start using the child (elisp) syntax table while between the escape characters?


texts:
When searching for text in evil mode using / key, then entering text. The value searched for isn't saved as it is in vim, where the up/down arrow keys can cycle search history.

Is it possible for emacs/evil mode to store each search as it does with : commands?

Update, isearch keys aren't configured for vim-like behavior.

I looked into this and the isearch keymap can be modified, will add own answer.


texts: How to use query-replace(-regexp) non-(semi-)interactively in a command?

texts:
The title isn't entirely accurate. By "non-interactively" I
mean, for lack of a better term, "semi-interactively". In a regular
call through M-% or M-x query-replace, the command could be called interactive
in two ways: 1) by giving the string to replace and the replacement 2)
by choosing one by one which matches to replace. The idea is to skip
the former step by giving fixed arguments (string-to-replace and
replacement-string), but to keep the latter interactive query
behavior.

Often a queried search & replace task needs to be repeated over time
(i.e. search and replace the same strings) so the obvious next step is
to write a simple command, for example, to create a
fix-two-or-more-spaces command replacing " \\{2,\\}" with a
single space.  How to achieve this?  Must admit I got a little
intimidated by perform-replace...


texts: How do I reduce spacing between lines to less than zero?

texts:
Using the Emacs GUI, I get a certain amount of spacing between each line of text. By default this spacing seems to be zero, but can be increased by customizing line spacing. This is the default of zero:

And this is the same text when line spacing is set to 2:

Because I'd like extra lines on my screen and don't think it would impact readability a lot, I'd like to use a line spacing of -1, so the lines overlap just slightly. How can I do this?


texts: Run command when opening a file of a specific filetype

texts:
I'm trying to get a lisp script to run some commands for me when I open a file of a specific filetype. I know that I'm working in the correct init file because if I remove the theme from it, emacs has no theme when I start it up.

This is the script I'm using which doesn't work (no errors or anything):

(defun my-project-hook (filename)
  (when (string= (file-name-extension filename) "ts")
    ((typescript-mode)
     (tss-setup-current-buffer))
  )
)

(add-hook 'after-load-functions 'my-project-hook)


texts: How do I customize the way Emacs prints out certain keys and key sequences?

texts:
For example, I want Control key to be displayed not as C but as ⎈ (U+2388 HELM SYMBOL) in the minibuffer.
Trying to personalize my Emacs and display all function keys as ISO symbols. And sequences to be displayed as something like ⎈ + x, ⎈ + f.
Is there a way to do it?


texts:
Just what the title says.

My org files often have large prefaces (area containing #+TAGS:, #+STARTUP, etc.) and would like to keep it folded most of the times.

How do I achieve this?


texts: Intermittently undo-tree aborts immediately after I CTL-P undo

texts:
Intermittently, I have a problem where I start an undo-tree-mode with C-X u. And as soon as I hit C-p to do an undo, the undo-tree pane closes.
This has been happening for a long while now. It happens when I use Spacemacs master or develop and Emacs 25, 26, or 27. I've even changed my keyboard.
There are no error messages in the *messages* buffer.
If I toggle the select mode, I can continue my undo to completion.
I have not been able to repeat the issue on demand. I can not determine the conditions that trigger it. Its driving me crazy.
Any idea on what it is or how I could debug this?


texts: Returning org-babel results from an asynchronous call

texts:
I'm currently experimenting with moving more of my development workflow into org-mode so I can keep better track of what testing I've done. However some of the steps involve asynchronous calls to RPC services. The following snippet shows the problem:

#+name: simple-async-example
#+begin_src emacs-lisp
  (async-start
     ;; What to do in the child process
     (lambda ()
       (message "This is a test")
       (sleep-for 3)
       222)

     ;; What to do when it finishes
     (lambda (result)
       (format "Async process done - result should be 222: %s" result)))
#+end_src

#+RESULTS: simple-async-example
: #<process emacs>

As you can see the result comes from the first task. What I need to do is append the actual result once the processing has been completed. Is there any way to achieve this?


texts: How to better control Emacs buffers in StumpWM?

texts:
I have been using Emacs more and more, to the point that I would like to start using StumpWM as my default window manager with it, so that I can integrate the missing bits of my workflow that realistically cannot (still) be done from inside Emacs alone. As the EmacsWiki puts it, "Stumpwm is the Emacs of window managers."

I have been trying Emacs from StumpWM, but I am going against a little 'context mismatch`, especially from controlling Emacs buffers in StumpWM.

I would like to match individual Emacs buffers as individual StumpWM frames. I thought perhaps one way would be to use Emacs' one-buffer-per-frame technique, but I am not sure it is a good way.

What kind of Emacs settings/libraries could be tweaked to better control Emacs buffers from StumpWM, so that each Emacs buffer corresponds to a StumpWM frame?

I do not experience this issue with other applications that I run from StumpWM, That is why I believe it is Emacs related, and I am asking it here on emacs.stackexchange.com

Thank you for any pointer.


texts: Can't view anything in org-agenda: Wrong number of arguments: (0 . 0), 2

texts:
Whenever I try to view my org-agenda, I get a blank buffer with "Wrong number of arguments: (0 . 0), 2" in the minibuffer. I've followed dozens of tutorials and bug reports and nothing applies. Can anyone help me?

I'm using Emacs 26.2, with Spacemacs 0.200.13.x, with no org preferences in my .emacs or .spacemacs files. The issue is only present when running as Spacemacs, with plain Emacs it works fine.

I launch agenda with M-x org-agenda-file-to-front, then M-x org-agenda a. It launches an agenda buffer that begins populating, but errors as soon as it hits an actual TODO item.


texts: Why does Evil autocomplete simpl. ESC to beta delta [] iota zeta.?

texts:
This might be a strange question but every time I type:

simpl. <ESC>

Evil substitutes it with:

simpl beta delta [] iota zeta.

this is driving me nuts. Why is this happening and more importantely, how do I stop it? I want to be able to escape Vim's insert mode without it doing some weird auto complete.

Note I am using ProofGeneral because I happen to be working with Coq.

For context my code:

Theorem zero_nbeq_S : forall n:nat,
  beq_nat 0 (S n) = false. (* 0 = S n ~ false *)
Proof.
  intros n. destruct n.
  - simpl. reflexivity.
  - simpl. simpl beta delta [] iota zeta.
Qed.


texts: autoload list of packages in Emacs 25.0.92

texts:
According to emacs.SE answer I am trying to make Emacs (version 25.0.92) autoload packages if they are not already installed on my computer. At my .emacs file now I have only:

(package-initialize)

(require 'package)

(setq package-archives '(("melpa" . "http://melpa.org/packages/")))

(setq my-package-list '(nyan-mode dired+))

(mapc #'package-install my-package-list)

But have an an error:

  error: Package ‘auctex-’ is unavailable

What I am doing wrong?


texts:
I use the packages Helm and helm-projectile for navigating in Emacs. I ran into problems, when I use projectile-helm inside Helm, and I'm able to reproduce this with a empty Emacs init file. The configuration to reproduce this:

;; Get MELPA
(add-to-list 'package-archives
             '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t)

;; Add Use-package to the list
(setq package-list
    '(use-package))

;; Install use-package
; activate all the packages
(package-initialize)

(use-package projectile
  :ensure t
  :diminish projectile-mode
  :config
  (projectile-global-mode)

(use-package helm-projectile
  :ensure t
  :config
  (projectile-global-mode)
  (helm-projectile-on))

(use-package helm
  :ensure t
  :commands helm-for-files
  :diminish helm-mode
  :config
  (helm-mode 1)
  (setq helm-for-files-preferred-list '(helm-source-recentf
                                        helm-source-projectile-files-list
                                        helm-source-projectile-recentf-list))

What will the problem be?

The directory foo contains two files:
foo.txt and .git.

The directory bar contains one files:
bar.txt.

When you're opening a file in directory foo:

foo/foo.txt

Then call M-x helm-find-files, the Helm window will show up, because it's a project file (because of the .git init file, so it can find files), so the source projectile-files-list will deliver the files.

But when you opening bar.txt in directory bar, then call M-x helm-find-files, it will not show up because it's probably still waiting on input from
    helm-source-projectile-files-list, in buffers *warnings*, or in buffer errors I can't find anything. I understand where this problem might come, but how could I tell Emacs, to not use helm-source-projectile-files-list when the buffer is currently not in a project (.git)?


texts:
I'm trying to setup folding for Abaqus/Calculix inp files.
The format is basically as follows: keywords are represented as * and it's contents are what follows. This is quite like org-mode.
So far I've tried origami but the results are not satisfactory. It either folds blocks delimited by {} or indented blocks, while neither of which are really necessary here.
I already have a basic major-mode setup for syntax highlighting. I'd like to know what I need to add so that I can emulate org like folding.
Vim, however, manages this off-the-shelf.


texts: Make emacs aware of updates to files and directories?

texts:
In Ubuntu, when I make change to directories or files outside emacs, it seems that emacs doesn't get the update.

For example, C-x C-f can't track the current directory which was just moved elsewhere outside emacs.

Another example: in a shell created by C-x shell, the autocompletion of directory or file name doesn't work, if the current directory has been moved elsewhere outside emacs.

Can I make emacs get the update made outside emacs? Thanks.


texts:
I was thinking about this question: Configuring org-export to replace LaTeX def macros

It seems like you should be able to convert latex macros in org export using an export filter. e.g., in the linked question, convert \R to \mathbb{R}. However, I can't figure out the syntax. I tried:

(require 'ox)
(defun my-latex-filter-r-macro (text backend info)
  "Replace \\R with \\mathbb{R}"
  (when (org-export-derived-backend-p backend 'html)
    (replace-regexp-in-string "\\\\R" "\\\\mathbb{R}" text)))

(add-to-list 'org-export-filter-plain-text-functions
             'my-latex-filter-r-macro)

And then exported the following org file to html:

* This is a headline
  Here I refer to \R in normal text.

However, the \R is not altered in export. I've tried different numbers of backslashes, with no success - 0, 1, 2 or 3 backslashes, and every r except for the escaped \R is converted to \mathbb{r}. With 4 or more backslashes, none of the r characters gets converted. So it looks like escaped characters are protected from export filters - is this so? Is ther anyway to pre-process escaped characters in org export?


texts:
I would like to view the (MD5) hash of the file at point in a dired buffer.

How can this be done?


texts: Keyboard shortcut for publishing a specific org-mode project

texts:
Following this guide, I have setup an org-mode project "foo" that I want to (frequently) publish using a single keyboard short.

Currently I have defined

(global-set-key (kbd "C-c C-1") 'org-publish)

so after typing C-c C-1, I still have to fill the prompt with the specific project I want to publish, here for example "foo".

How do I setup a shortcut that automatically publishes the project "foo" without additional prompts?


texts: Good methods for setting up alarms (audio + visual) triggered by org-mode events?

texts:
I would like to have alarms set off based on org-mode events associated with specific times (or start times).  Ideally these would be audio and visual, and able to be customised to some extent.  I used to use Sauron, but I can't get it to work with org-mode events (or email notificiations) anymore.  What are other good methods?

(I'm particularly interested in having the notification be displayed not only on screen via the notification daemon, but also spoken (text-to-speech). I'm on Linux.)


texts: Disable default key binding in evil mode for evil leader

texts:
I'm using evil-leader and bind the leader key to <SPC>. Evil-leader config follows after evil-mode in .emacs file.

Problem: Sometimes when I hits <SPC>, it uses default forward char of evil-mode.

I added this line to unset the key.

(define-key evil-normal-state-map (kbd "SPC") nil)

It still doesn't help. So I M-x + evil-leader-mode every time the problem occur.

My full code is as below:

;; evil-mode
(evil-mode t)

(require 'evil-leader)
(global-evil-leader-mode)
(setq evil-leader/in-all-states 1)
;; unbind evil dafault SPC of forward char
(define-key evil-normal-state-map (kbd "SPC") nil)
(evil-leader/set-leader "<SPC>")
(evil-leader/set-key
  "f" 'helm-find-files)


texts: Error when folder of an open buffer is deleted outside emacs

texts:
I get this error when I am trying to swtch buffer and a folder of an open buffer is deleted outside emacs:

Error in post-command-hook (evil-mode-check-buffers): (file-error "Setting current directory" "directory not found")

I think it would be better to just close the buffer or offer the user to save open files elsewhere instead of giving error and block all other commands.

Is there a way to avoid the blockage?


texts:
I want to write some lisp that will take the cwd, and keep traversing up the dirctory tree until it finds a file (in this case config.rb) then when it finds it I want to parse the contents (in this case:

require 'compass/import-once/activate'
# Require any additional compass plugins here.

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"

for example to extract the value for sass_dir

Then I want to navigate back into that directory.

This is all because the scss compile mode doesnt work as it tries to compile in the CWD of the buffer which is not how compass works.

I've been wanting to develop my lisp skills anyhow so learning the above techniques would be great if anyone can help.

Many thanks.

I have done:

(defcustom scss-sass-command "compass compile"
"Command used to compile SCSS files, should be sass or the complete path to your sass runnable example:"
 :group 'scss)

(defun get-compass-root-dir()
    "Get the root folder for the sass project to run compass command in"
    (locate-dominating-file buffer-file-name "config.rb"))

(defun scss-compile()
    "Compiles the directory belonging to the current buffer, using the option"
      (interactive)
      (message (get-compass-root-dir))
      (let ((default-directory (get-compass-root-dir))))
      (message (pwd))
      (compile scss-sass-command))

But I just dont seem to be nailing it. Compass complains there are no files to compile and my attempts to message out the directories to see what is going on dont seem to be working. I have byte compiled the file and relaunced emacs.

Anybody have any suggestions?


texts: how to read messages which appear after `C-x C-c`?

texts:
When I exit emacs via C-x C-c (save-buffers-kill-terminal) it prints a message in minibuffer. I can't read the message because the frame gets destroyed too fast.

I'd like to read the message(s), how can I do this?


texts:
Many procedures in Emacs write to the *Messages* buffer. I usually kill it from time to time. My problem is that the content gets deleted once the buffer get killed. Is there a way to preserve the contents of the *Messages* buffer throughout an Emacs session or even throughout multiple sessions?

I found a related topic here, but was unable to fit it to the *Messages* buffer?
How can I save my mini-buffer history in Emacs?


texts: how to manage elint dragging in lots of .gz files

texts:
When I invoke elint-current-buffer on a buffer of Lisp code, Emacs starts dragging in 75 !! compressed .el.gz files, leaving me with a huge pile of unwanted active buffers containing those files.

Is there any way to set a config option (or do something else) to avoid this issue? I searched for elint doc, but could only find an empty EmacsWiki page, nothing in the Emacs/Elisp manuals, no meaningful doc on the web.


texts: Org mode: Display only tasks under a specific headline in the agenda

texts:
As part of a weekly review, I'd like to have a block agenda that displays only the subtrees under the "Inbox" heading in my inbox.org file (which is part of org-agenda-files). To do that, I believe I would need to use a user-defined function.

(setq org-agenda-custom-commands
  '(; Weekly Review block agenda
    ("r" . "Weekly Review")
    ("r1" "Review unprocessed items in Inbox"
      my/org-get-items-under-headline "Inbox"
      ((org-agenda-overriding-header "Inbox items to process:")))
    ; ...
   ))

I need help writing the my/org-get-items-under-headline function, which should take the parameter heading and return all the subtree headlines under it. Unfortunately I'm not quite sure what kind of format org-agenda-custom-commands is looking for.

My inbox.org file looks relatively simple.

* Inbox
** Task 1
   :PROPERTIES:...
** Task 2
   :PROPERTIES:...
* Processing

So the block agenda should only display the Task 1 and Task 2 headlines.


texts:
On my mac (OSX) I have many org-mode files with filenames ending in “.org”.

Whenever I do a search with Spotlight that should show one of these org files as best result I experience the following problems:

The best org file often doesn’t appear on the results. Almost all the times, if there is the backup file (the “tilde” file ending with a ~), it’s displayed but not the original org file.
If spotlight decides to show the org file, it tends to be shown at the end of the list in the "Other" category.

If I do the same kind of research on files ending with txt spotlight does exactly what is supposed to do, the files pops on top of the results list.

Do you know a solution to this problem?

Is it possible to instruct spotlight to handle *.org files like *.txt (or other text format) files?


texts: In spacemacs, how do I copy code from the history in python REPL to my window which has a python source code file open?

texts:
I'm new to spacemacs -- I'm using it as a Python IDE.

I'd like to know if there is an easy way to copy lines from the history on a REPL back to the source-code window.

The idea is, I prototype in the REPL and I'd like to copy and clean the code out in the source code window.

Thanks.


texts: Can I get the bindings output that Helm shows into another buffer?

texts: I know that I can bring up a Helm buffer which shows available bindings. But I would like to do some scripting around available keybindings and commands. Is there a way to dump that output to a regular buffer rather than to Helm?


texts:
I have some sort of fundamental confusion about using src blocks in org mode.

I define a custom latex class in an emacs-lisp src block at the top of my org file. Export fails however, unless I manually execute the src block (because the required latex class doesn't exist until the src block is executed). I'm not prompted for permission to execute the block.

As a minimal example, I tried exporting this:

#+name: test
#+begin_src emacs-lisp
(message "Success")
#+end_src

On export, I see org-babel-exp processing... in my messages buffer, and I would expect to see "Success" immediately after it, but I don't.

I'm clearly missing something obvious, but it's not clear to me from the info what I should be doing.


texts:
I want to use org-drill to do flashcard type training on my
ubuntu computer as was showcased in a few youtube videos. It is not
clear to me that it works out of the box in 2019.
GNU Emacs 25.2.2 Org-mode version 8.2.10
Followed instructions [[https://orgmode.org/worg/org-contrib/org-drill.html][orgmode.org::org-drill]] after searching the
backbone for org-drill

contrib/lisp was not found in the machine using locate
I appended (require 'org-drill) to the end of my ~/.emacs
and was greeted with a friendly messsage once I restarted emacs.

+begin_src error

Warning (initialization): An error occurred while loading
‘/home/theusername/.emacs’: File error: Cannot open load file, No
such file or directory, org-drill To ensure normal operation, you
should investigate and remove the cause of the error in your
initialization file.  Start Emacs with the ‘--debug-init’ option
to view a complete error backtrace.

+end_src
Deleted the require line, restart emacs to try the other
method. Interactive (customize-variable org-modules) -> [X] C
drill:. The echo area tells me there is an error when I click
Apply.

+begin_src Messages

Problems while trying to load feature ‘org-drill’

+end_src

Using Apply and Save appended the symbol org-drill to the
list of things under org-modules inside of my .emacs. [X] C
drill: is checked once emacs restarts and the function is not in
the namespace of interactive autocomplete.

Not sure what to try next.

[[https://bitbucket.org/eeeickythump/org-drill/src/default/][Paul Sexton's bitbucket]] The author maintains org-drill on
Atlassian? It is unclear how this
[[https://stackoverflow.com/questions/34983106/how-to-install-org-drill][Tahir Hassan @ stack overflow 2015]]

+begin_src 2015

Org-drill in official org-mode repository is out-of-date (2015),
and seems that might be the best decision to install the top-notch
version from BitBucket.

+end_src

[[https://melpa.org/#/org-drill][org-drill at melpa July 2019]] Maybe I should try getting it from
melpa? I have never used melpa before.


texts: What is a good strategy to locating function arguments in a buffer?

texts:
I'd like to create a few routines for manipulating function arguments in buffers, which of course requires me to first locate the arguments.  Suppose that I'm operating on a buffer with a programming language with a C-like syntax,  then I could search for the commas to delimit arguments.  The difficulty arises when you have arguments that are calls to other functions, because those can also include commas that I wouldn't want to consider, as in the following example (the carrots point to the commas that I want to find).

somefun(w, f(x1, g(y1, y2)), h(z1, z2))
         ^                 ^

Assuming that I've already located the start of the arguments list, my current plan is to repeatedly use forward-sexp to advance past the nested elements in the syntax tree and then check if the next non-whitespace character is a comma.  But is there a more robust or idiomatic way to approach this?


texts:
Because of helm selecting directories in a way that I'm not used to, I often select a project sub-directory instead of project root, when I intend to index the whole project.
After doing it wrong, I can run ggtags-create-tags again on the right location (so with helm, I need to go back one step up from my project root, then select the project root from there), but the subsequent searches still use the GTAGS file in the sub-directory.
How do I select the newer GTAGS file in the project root, short of deleting the sub-directory's GTAGS?
ggtags-update-tags and ggtags-reload did not help.


texts: How to open windows with 85 characters width

texts:
Newbie question

In my Preferences.el file there is a line
(setq-default fill-column 78)
which works wonderfully.

Now I need to tell Emacs (Aqumacs in my case) to open windows
with 85 characters width, so that I do not have to resize every
window when it opens (as they open with around 60 characters width only).

How do I do that?


texts: Who is "juergen" and why can I see the value of his exec-path?

texts:
I noticed something strange when calling C-h v (describe-variable) on exec-path today:

exec-path is a variable defined in `C source code'.
Its value is
("/usr/bin" ...)
Original value was
("/home/juergen/.opam/4.02.0/bin" "/home/juergen/.cabal/bin" "/usr/local/sbin" "/usr/local/bin" "/usr/bin" "/opt/google-appengine-java/bin" "/usr/lib/jvm/default/bin" "/usr/bin/site_perl" "/usr/bin/vendor_perl" "/usr/bin/core_perl" "/home/juergen/Android/ndk/" "/home/juergen/.gem/ruby/2.0.0/bin/" "/home/juergen/bin/" "/home/juergen/bin/gnome-terminal-colors-solarized" "/home/juergen/tmp/emacs/trunk/src/emacs-24.4/lib-src" "/usr/lib/emacs/24.4/x86_64-unknown-linux-gnu")

The thing is, there is no user called juergen on my system.
Q: Is this the exec-path of the user who originally compiled the Emacs binary I am using? If so, why does its value get carried over into a binary that is distributed to end users? Shouldn't exec-path have a more generic default value (i.e., a value that doesn't include any /home/juergen entries)?


texts:
How can I reopen a closed window in Spacemacs? Something like Cmd-Shift-t in Chrome.

I open a window using SPC w s and delete it with SPC w d, but I don't know how to reopen one that I've closed.


texts:
Since 1 month ago, I have been experiencing this issue. I already tried to launch emacs with emacs --with-x-toolkit=lucid But the problem persists, anyone experiencing the same issue?

Fatal error 11: Segmentation fault Backtrace: emacs[0x507999]
emacs[0x4ee55c] emacs[0x50613e] emacs[0x506363] emacs[0x5063cf]
/usr/lib/libpthread.so.0(+0x11da0)[0x7fbbaeb47da0]
/usr/lib/libgobject-2.0.so.0(g_type_check_instance_is_fundamentally_a+0x31)[0x7fbbb31fb4d1]
/usr/lib/libgobject-2.0.so.0(g_object_unref+0x15)[0x7fbbb31da8e5]
/usr/lib/libgtk-3.so.0(+0x20e04d)[0x7fbbb444804d]
/usr/lib/libgobject-2.0.so.0(g_object_unref+0x1a2)[0x7fbbb31daa72]
/usr/lib/libgtk-3.so.0(+0x11afdc)[0x7fbbb4354fdc]
/usr/lib/libgtk-3.so.0(+0x1681b1)[0x7fbbb43a21b1]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0xb1)[0x7fbbb31d5dc1]
/usr/lib/libgobject-2.0.so.0(+0x22622)[0x7fbbb31e8622]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0xa75)[0x7fbbb31f0c85]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x8f)[0x7fbbb31f169f]
/usr/lib/libgtk-3.so.0(+0x39276e)[0x7fbbb45cc76e]
/usr/lib/libgobject-2.0.so.0(g_object_run_dispose+0x48)[0x7fbbb31dc3d8]
/usr/lib/libgtk-3.so.0(+0x1681b1)[0x7fbbb43a21b1]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0xb1)[0x7fbbb31d5dc1]
/usr/lib/libgobject-2.0.so.0(+0x22622)[0x7fbbb31e8622]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0xa75)[0x7fbbb31f0c85]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x8f)[0x7fbbb31f169f]
/usr/lib/libgtk-3.so.0(+0x39276e)[0x7fbbb45cc76e]
/usr/lib/libgobject-2.0.so.0(g_object_run_dispose+0x48)[0x7fbbb31dc3d8]
/usr/lib/libgtk-3.so.0(+0x1681b1)[0x7fbbb43a21b1]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0xb1)[0x7fbbb31d5dc1]
/usr/lib/libgobject-2.0.so.0(+0x22622)[0x7fbbb31e8622]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0xa75)[0x7fbbb31f0c85]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x8f)[0x7fbbb31f169f]
/usr/lib/libgtk-3.so.0(+0x39276e)[0x7fbbb45cc76e]
/usr/lib/libgobject-2.0.so.0(g_object_run_dispose+0x48)[0x7fbbb31dc3d8]
/usr/lib/libgtk-3.so.0(+0x1681b1)[0x7fbbb43a21b1]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x19d)[0x7fbbb31d5ead]
/usr/lib/libgobject-2.0.so.0(+0x22622)[0x7fbbb31e8622]
/usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0xa75)[0x7fbbb31f0c85]
/usr/lib/libgobject-2.0.so.0(g_signal_emit+0x8f)[0x7fbbb31f169f]
/usr/lib/libgtk-3.so.0(+0x39276e)[0x7fbbb45cc76e]
/usr/lib/libgobject-2.0.so.0(g_object_unref+0x133)[0x7fbbb31daa03]
/usr/lib/libgtk-3.so.0(gtk_container_remove+0xa6)[0x7fbbb43a0656]
emacs[0x4e2e51] ... [1]    10803 segmentation fault (core dumped)
emacs --with-x-toolkit=lucid


texts:
I want dired buffers to be included in jump list so I can visit them with Ctrl-i and Ctrl-o. One possible catch is that My Ctrl-x d binding is taken by ido-dired. What I've tried so far (without success):

(evil-add-command-properties #'ido-dired :jump t)
(evil-add-command-properties #'dired-jump :jump t)
(evil-add-command-properties #'dired-noselect :jump t)
(evil-add-command-properties #'dired :jump t)
(evil-add-command-properties #'ido-file-internal :jump t)


texts:
Emacs 26.1
Here json file:

[
  {
    "id": 11,
    "name": "my name"
  },
  {
    "id": 22,
    "name": "my name3"
  },
  {
    "id": 33,
    "name": "my name3"
  }
]

As you can see the count of elements are 3.
Nice.
Is it possible to get count of elements?
Suppose I has large json and I need to get count of elements?
Maybe has some method that can do this.

P.S.
Structure of one item is:

{
    "id": xx,
    "name": "xxxx"
  }


texts: Change table of contents title in Org mode according to document language for beamer export

texts:
I'm exporting a *.org file to pdf using LaTeX as a beamer presentation. I want to change the title of the TOC slide to Spanish.

I've tried the solutions described in this question, but they don't work for me.  In one of the answers there is even a comment saying that the solutions don't work for beamer.

Is there any way to accomplish this without manually editing the *.tex file?


texts:
Is there a way so that the Emacs are able to tell if the current user is undoing/redoing in the current buffer?

Here is the task I want to accomplish, I have add a hook to after-change-function, it all works out great exclusive of when I hit undo/redo this hook get called too. And this is what I want to avoid... Is there other way to get around this issue?


texts:
Is it possible to add a watch statement in Indium like you can in the node debugging utility?

from Debugger | Node.js v9.10.1 Documentation:

  It is possible to watch expression and variable values while
  debugging. On every breakpoint, each expression from the watchers list
  will be evaluated in the current context and displayed immediately
  before the breakpoint's source code listing.


texts:
I'm using emacs 25.1.

I know that I can send a message to the echo area via (message "Message text"). However, that message disappears whenever buffers are switched or other similar changes take place during my emacs session.

I assume that this is because various internal emacs functions sometimes do the equivalent of (message nil).

Is there a way to send a message to the echo area and have it always persist until I explicitly remove it?

I don't care if the echo area is overwritten when the minibuffer is used. I'm only wanting to keep messages persistent in the echo area for as long as no minibuffer interaction is taking place.


texts: Does org mode supports "session" header argument for emacs-lisp source block?

texts:
#+BEGIN_SRC emacs-lisp :results silent :session first
  (setq one 1)
#+END_SRC

#+BEGIN_SRC emacs-lisp :results output :session second
  (print one)
#+END_SRC

#+RESULTS:
:
: 1

If org mode supports :session argument for emacs-lisp source block,
could you point out why the second session mentioned above prints 1 as output instead of giving error for variable is void


texts:
I am using emacs-24.3, which comes with python.el and IPython support out of the box (or so they say).

Is there documentation for this mode? Where can I find it?


texts: Key to move to next ancestor heading in org mode

texts:
I would like to jump to the next parent heading from a lower level directly. Is there a shortcut for that in org mode?
* a
** b
** c
* d

So to jump, say, from b to d.


texts: spaceline (modeline) truncate filename directory

texts:
I believe I've seen a type of abbreviation with some(?) modeline packages that I'd like to implement in spaceline (I'd be willing to switch modelines for a good reason). I want to abbreviate the buffer-file-name to shorten directories to single characters (ideally, only if it is overflowing some other text). For example, instead of ~/.emacs.d/layers/display.org, I'd like to see ~/.e/l/display.org or ~/./l/display.org for the buffer-file-name. Significant flexibility (e.g., min buffer-file-name length before truncating, length of truncation, etc.) would be appreciated, but I'll settle for any improvement over (abbreviate-file-name (buffer-file-name).
My full spaceline config is as follows:
(use-package spaceline-config
  :ensure spaceline
  :config

  (spaceline-helm-mode 1)

  (setq spaceline-highlight-face-func 'spaceline-highlight-face-evil-state)

  (spaceline-define-segment buffer-id
    (if (buffer-file-name)
        (abbreviate-file-name (buffer-file-name))
      (powerline-buffer-id)))

  (spaceline-install
   'main
   '((buffer-modified)
     ((remote-host buffer-id) :face highlight-face)
     (process :when active)
     (major-mode))

   '((selection-info :face 'region :when mark-active)
     ((flycheck-error flycheck-warning flycheck-info) :when active)
     (python-pyvenv :fallback python-pyenv)
     (global :when active)
     (version-control :when active)
     (line-column)
     (buffer-position)
     (hud))))

There's typically not a lot of text in my modeline, unless I'm several directories deep, and this becomes a problem when I split the window vertically (all the segments on the right-hand-side are gone).


texts:
I'd like to use M-<arrows> to move around windows in Emacs gtk, so I have added

(windmove-default-keybindings 'meta)

to my init.el. However, this is overridden by other modes such as elpy. Is there any direct way to give such a command absolute priority on keybindings, ignoring other modes' own keybindings?


texts: I want xref-find-definitions that uses the second backend when the first backend doesn't find anything

texts: I program in Haskell using lsp-mode with lsp-haskell. I need to have a working "jump to definition". xref-find-definitions using lsp--xref-backend sometimes fails to find the definition. xref-find-definitions using etags--xref-backend usually finds the definition together with other unrelated definitions. I want to have a command that runs lsp--xref-backend first, and if it doesn't find anything, runs etags--xref-backend. How do I achieve that? Simply setting xref-backend-functions to '(lsp--xref-backend etags--xref-backend) never invokes the etags backend even when the lsp backend doesn't find anything.


texts: How to check if my emacsclient is running in a GUI window?

texts:
Emacs version: 25.3.50.2
I'm using Fira Code font whose ligatures are now supported by Emacs.
To solve this, I used this solution (I think it's not important, just to inform you), say, replacing the ligaturable text with a single large symbol.

However, I use Emacs GUI/Emacs CLI the same often. In CLI, I just have to configure the console's font. Since I use Konsole which supports ligature, I should do nothing with my Emacs. In GUI, I have to do the replacing job.

The solution mentioned above used this code:

;;; Fira code
;; This works when using emacs --daemon + emacsclient
(add-hook 'after-make-frame-functions (lambda (frame) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")))
;; This works when using emacs without server/client
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")
;; I haven't found one statement that makes both of the above situations work, so I use both for now

But if I'm using emacsclient in CLI, it still replace the symbols, and my console connot display those weired symbols (of course!).
That is to say, the code above will work when I'm using Emacs GUI, and
 emacsclient in both GUI and CLI.

What I want is, to prevent it from working when using emacsclient+CLI.

What can I do?

Conclusion for impatient answerers

I want to run some elisp code only when using emacsclient with GUI. How can I do it?


texts:
Evil has a beautiful :s(ubstitute) implementation, which shows the regexp inline as you type:

However, the feature doesn't exist for the global command, :g (such that :%g/emacs/... will find the line as expected, but nothing will appear until the command is executed). Do there exist easy ways to include this feature, and bind to the Evil substitute command?


texts: Unwanted email address warning in Rmail emacs 27.1

texts:
emacs 27.1 Rmail asks for confirmation
"Email address %s looks invalid; send anyway?"
when sending email to a local recipient address without "@domain" part.
Can this be suppressed?
It did not occur in V. 26.3 and earlier.
It seems to be created by the function message-check-recipients
in emacs-27.1/lisp/gnus/message.el


texts: It is possible to manually toggle sign for a message, I wonder how it can be done for any message created?


texts: `vc-root-dir` is not a valid command name

texts:
Trying to use the vc-root-dir function on Emacs gives the error message vc-root-dir is not a valid command name

On inspecting vc.elc as found by locate-library the function appears to exist as a defalias.

emacs-version is 26.1 FYI


texts:
(defvar foo-smie-grammar
  (smie-prec2->grammar
   (smie-bnf->prec2
    '((exp (exp "+" exp)
           (exp "*" exp)
           ("let" let-decls "in" exp))
      (let-decls (let-decls ";" let-decls)
                 (exp)))
    '((assoc ";") (assoc "+") (assoc "*")))))

The above gives warnings:

Warning (smie): Conflict: in >/< *
Warning (smie): Conflict: in >/< +
Warning (smie): Total: 2 warnings

Without the let-decls non-terminal, all is fine.  How do I fix this?  The grammar isn't obviously problematic to me.


texts: BBDB (version 3) search at point or for selected text

texts: I'd like to start a BBDB search directly with the word at the current cursor point or with the current selection.  Is there already a short-cut or at least a function for these functionalities?


texts: Using default results with ivy and `read-file-name`

texts:
I have recently started using ivy, and I've been very happy with it. The only behaviour which I've found quite surprising, is the combination of completions and read-file-name. As an example, if I evaluate the following snippet with ivy switched off, and just press return, I get the expected result that "test" is printed.

(let* ((default "test")
       (name (read-file-name (format "Master file (default %s): "
                                     (or default "this file"))
                             nil default)))
  (print name))

If instead I evaluate the code with ivy running, and just press return, ivy selects the first filename completion candidate (./), and /home/myusername is printed. There are quite a few different packages that I use which ask for filenames, but supply a sensible default value.

Ideally, I would like to be able to press return to use the default value, or start typing and have all of ivy's completion facilities handy. Is there any way of achieving that?


texts: Open folder `/ssh:example.com` or file in it

texts:
You can open SSH resources in Emacs. Unfortunately, the pathspec used for SSH resources conflicts with possible paths in the virtual file system.

If I run

sudo mkdir "/ssh:example.com"
sudo touch "/ssh:example.com/file"

, I cannot figure out a way to edit the file I just created via Emacs except moving it or creating another hard link. Is there a way to edit this file in Emacs if you can't do that, for example because you don't have write privileges in the directory where the file is?


texts: re-search-forward unexpected behavior: case insensitive

texts:
According to the documentation of this function, it should be case sensitive. But when I test it out, the result is case insensitive.

My emacs version is 25.3.2.


texts:
I'm trying to remap <C-right> key action from sp-forward-slurp-sexp, which is set in Prelude by default, to right-word. I tried to put that code in my init.el in .emacs.d/personal folder:

(global-unset-key (kbd "<C-right>"))
(global-set-key (kbd "<C-right>") 'right-word)

But this not work. Other code in init.el works well. Also i tried execute that code manually, via C-x C-e.

Update

Seems like i explained my problem wrong (sry for my bad English).

The problem is: after executing code above, behavior of key binding does not change, it still execute sp-forward-slurp-sexp.


texts: Why are emacsclient and emacs separate programs?

texts:
I really like the client-server structure of emacs.
However, I feel uncomfortable to run 'emacsclient' to attach to running emacs server.
Is there any specific reason that emacs seperated emacsclient from emacs binary? Is it possible to integrate them without hacky-dirty shell aliasing?


texts:
im looking for a way/function to kill/delete alll whitespace/empty area in a region to start of line. for example if i have this snippet

(defhydra hydra-copy-paste  (:color blue  :columns 4 :hints nil)
  "copy paste operations"
     ("0" z/copy-buffer-file-path  "copy current buffer to path" )
("a" align-regexp "align-regexp" )
  ("c" copy-to-register  "copy to register")
("e" hydra-edit-extra/body  "Extra editing commands" :face 'hydra-face-purple)

    ("d" downcase-region  "downcase " )
("p" insert-register  "paste from register")
("v" view-register  "view register")
    ("r" z/open-this-file-as-other-user  "edit as root" :face 'hydra-face-red )
    ("u" upcase-region  "upcase " )
("q" nil "cancel" nil)
)

i want it to run and format the section by killing all whitespace till start of line so it looks like this

(defhydra hydra-copy-paste  (:color blue  :columns 4 :hints nil)
"copy paste operations"
("0" z/copy-buffer-file-path  "copy current buffer to path" )
("a" align-regexp "align-regexp" )
("c" copy-to-register  "copy to register")
("e" hydra-edit-extra/body  "Extra editing commands" :face 'hydra-face-purple)
("d" downcase-region  "downcase " )
("p" insert-register  "paste from register")
("v" view-register  "view register")
("r" z/open-this-file-as-other-user  "edit as root" :face 'hydra-face-red )
("u" upcase-region  "upcase " )
("q" nil "cancel" nil)
)


texts: How can I delete all the gdb related windows/buffers after `q` in gdb CLI window

texts: I use (setq gdb-many-windows t) and (setq gdb-show-main t) configurations in my init.el, so after executing M-x gdb, there will be six windows in the frame, after typing q in the main gdb cli window to finish debugging, how can I quit/delete all the gdb related windows/buffers (including the current gdb CLI, locals, breakpoints, stack frames...) and just leave the source code buffer open at the same time.


texts: reshape one column text of n rows into into m columns of n/m rows

texts:
I have tried the following function

(defun test3 (size column cnt)
  (interactive "p")
  (if (eq cnt 0)
      (progn
        (setq start (point))
        (forward-line (- (/ size column) 1))
        (end-of-line)
        (kill-rectangle start (point))
        (forward-line 1))
    (progn
      (setq tmp (point))
      (yank-rectangle)
      (end-of-line)
      (kill-rectangle tmp (point))
      (forward-char 1)))
      (if (eq column 1)
          (return (yank-rectangle)))
      (test3 size (- column 1) (+ cnt 1)))

I provide some close answer to a column of 40 a's to be split into 4 columns of 10 rows. Can you suggest any improvements? The idea is to generalize the operation to lines with more than 1 character

To be concise

a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a

Example of desired output (from 20x1 to 4 x 5)

aaaaa
aaaaa
aaaaa
aaaaa


texts: Resize attached image upon sending mail in mu4e

texts:
I use mu4e for email. An attachment is simply text:

<#part filename="/absolute/path/to/file" disposition=attachment>
<#/part>

Can mu4e resize the attachment upon sending, e.g. converting a 3 MB JPEG image to a much smaller size?


texts: A way to check if "(current-kill 0)" will run onto an error before it happens

texts:
I have an Elisp part involving (current-kill 0) to copy the current clipboard content into a variable.  This works flawlessly as long as the kill-ring has content.  However, if I just started the computer and did not copy anything yet (or use the command-line version of Emacs), running that script runs into the error "Kill ring is empty".
Trying (cond (kill-ring) my_code) seems dodgy since when starting Emacs and before (current-kill 0) is executed, kill-ring is actually nil as per C-h v kill-ring.
Is there a reliable way to find out if the clipboard actually holds content without getting the code running onto an error?


texts:
I am trying to develop an application with gtk3 in c++ and I am using Spacemacs as my main emacs distribution in addition to lsp for c++.

In my main cpp file, I included the following header :

#include <gtkmm.h>

However lsp gives me this error message :

'gtkmm.h' file not found [pp_file_not_found]

So how can I tell to lsp that I am using an external header (here gtk library) in my project? Is it possible to have auto completion for gtk then?


texts: How to bulk mark agenda items based on file name?

texts:
my org-agenda todo list looks something like this:
  inbox:      TODO learn how to process the inbox
  inbox:      TODO learn how to create a useful org agenda
  foo:        TODO start the project

I want to use org-agenda-bulk-mark-regexp to mark all the items residing in my inbox. I'm invoking the function like (org-agenda-bulk-mark-regexp "inbox:"). However, this doesn't select the items in the inbox. It only works on items that contain inbox: in their header.
How can I select these items?


texts:
The following in my .emacs file does not produced the desired result of showing me the word count for the current buffer (it "does nothing"):

(global-set-key (kbd "<f9>") (kbd "C-u M-="))

Is this because M-= is an interactive function? Would I need a function to do this?


texts:
When starting a server it's possible to set a name for the server (http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html). These names are to be useful for connecting emacsclients to those servers, however it would be nice to switch some behavior in my config based on the server name(my initial thoughts are changing the theme).

I've dug around on google and the best way seems to be setting an env var and then reading that back in the configuration (http://www.emacswiki.org/emacs/EmacsAsDaemon#toc13). I can't seem to find a way to get this information from within emacs without setting the env var, and I'd rather not have to run a separate wrapper just to know what server is running. How would I go about finding this information programmatically?


texts:
I defined these lines in my .emacs initialization file to change the location for backup and auto-save files.

(defvar BACKDIR (expand-file-name "~/emacs_backup/"))
(setq backup-directory-alist `((".*" . ,BACKDIR)))
(setq auto-save-file-name-transforms `((".*" ,BACKDIR t)))

However, i got an error all the time it is gonna perform an auto-save as it follows:

  Auto-saving define_transistors.tcl: Opening output file: no such file
  or directory,
  /home/SchoolServer/UserID/emacs_backup/home/SchoolServer/UserID/Projects/char_tst/charscript/#!home!SchoolServer!UserID!Projects!char_tst!charscript!define_transistors.tcl#

Any idea how to fix it?


texts: How to get sorted output from counsel-git-grep with ivy?

texts:
When using git-grep, the output isn't sorted alphabetically which makes navigating the results more tedious then it should be.

Is there a way to sort the output?

I checked git-grep and it seems there are no options to do this from within git itself.


texts:
I cannot get ps-pinting working in emacs I have a lisp file, and when I try to translate to ps I only get the file with an error

C-u M-x ps-print-buffer-with-faces

I get this file:

https://ufile.io/1f0f0

It has an error

I'm using Mac Os Sierra, emacs 26.0, but the same configuration on other cmputer but with Captain works, I user the same .emacs.d for both emacs, for example converting an org file to latex pdf it works well in both environments


texts:
I've got a macbook pro with a retina display and Emacs 24.5.
DocView rendering of pdf are very blurry. There is a few threads on the subjects but they deal with setting a higher resolution which didn't work for me.
I wrote on my .emacs

(setq doc-view-resolution 300)
(require 'doc-view)

But it had no effect.

Does anybody know how to deal with it ?
Any help would be grateful.


texts: tab and spaces shown aligned in emacs C++ mode, but not in other editors

texts:
In Emacs' C++ mode, I sometimes accidentally introduced a tab where I should use four whitespaces instead to create indentations. Adjacent lines with mixed uses of tabs and spaces for indentations are shown to be aligned in C++ mode.

But when I open the C++ file thus created in another editor, for example in Eclipse CDT editor, it will show that the indentations of the lines mentioned above are not actually aligned, because of mixed uses of tabs and spaces.

This makes me realized that Emacs C++ mode is not actually a pure text editor.
A tab is probably not shown as wide as four whitespaces, and that makes me add more or less tabs than I should for aligning with other lines' indentations.

In Emacs C++ mode, how can I avoid making such mistakes?

Thanks.


texts: How to run commands from other packages if they exist, without depending on them?

texts:
I have  package that has no relation to evil-mode, but doesn't work well when the command is repeated.

While the repeat command can be disabled, I don't want to add a dependency on evil mode just to do this.

I also want to avoid the load-order of my package and evil causing my package not to detect evil mode.

While this works, it's not elegant, is there a better way to handle this?

(if (fboundp 'evil-declare-not-repeat)
  (progn
    (evil-declare-not-repeat 'my-foo-cmd)
    (evil-declare-not-repeat 'my-bar-cmd)
    (evil-declare-not-repeat 'my-baz-cmd))
  (with-eval-after-load 'evil
    (evil-declare-not-repeat 'my-foo-cmd)
    (evil-declare-not-repeat 'my-bar-cmd)
    (evil-declare-not-repeat 'my-baz-cmd)))


texts:
i get this error in emacs when runing a rust file (have rust and cargo):

cargo run
/bin/bash: cargo: command not found

Compilation exited abnormally with code 127 at Thu Aug  8 20:28:50

yet i have cargo  :

cargo --version
cargo 1.36.0 (c4fcfb725 2019-05-15)

type -a cargo
cargo is /var/root/.cargo/bin/cargo


texts:
When exporting source code blocks in Org 8.2.10 to HTML, some programming languages (e.g. Java)  display the language name on hover, like so:

But for other languages (e.g. Common Lisp), no name displays on hover.

Is this expected behavior, or a bug?


texts: is there a function that can partially apply arguments on a function with order?

texts:
apply-partially cannot specify the order.

Is there one from the default Emacs installation that can specify order?


texts: How to use skewer mode beyond localhost?

texts:
I'd like to write the code for a website on one pc and see the results in a browser on another pc in my local network.

For calling the skewer script in html, I replaced localhost with the local ip of pc1 – <script src="*pc1.ip*:8080/skewer"></script>.

But simple-httpd seems to only serve the site (and skewer script) on localhost, when I try to access *pc1.ip*:8080 via pc2 I get ERR_CONNECTION_REFUSED.

Other simple http serve solutions (i.e. python -m http.server 8080) are accessable via local network, however they don't "interact" with skewer.

Is there a way to access simple-httpd via non-localhost? Or maybe a way to connect skewer and another serving solution?

/EDIT1 - after DoMiNeLa10♦'s comment/
Tried to set httpd-host to pc1.ip – now I can access the page via pc2 – but no skewer functionality (no autorefresh on save, no skewer-eval-*,…).

/EDIT2 - again thanks to DoMiNeLa10♦'s comment/
Tried adding a domain name for pc1 ("pc1" ^^) in /etc/hosts on both pc
and changed to <script src="http://pc1:8080/skewer"></script> in html.
No luck –> ERR_CONNECTION_REFUSED on pc2


texts: package-install doesn't pick up dependencies that are already in site-lisp

texts:
I have a bunch of software git-cloned into my site-lisp/ directory. It and all of its sub-directories are in my load-path. The problem I noticed is that package-install sometimes insists on pulling dependencies into elpa/ even when such packages already exist in site-lisp/. To be more specific:

package-install helm-descbinds insists on installing Helm 1.5 even though not only do I have the latest helm in in my load-path from site-lisp/helm/ but by the time the install gets called, (require 'helm-config) will have happened.

Who's at fault here? Is it the helm-descbinds package itself and I should be raising an issue with its maintainers? Or is there some obvious knob I need to turn in packages so the existing functionality gets picked up? Basically I just want to be sure that stuff in site-lisp/ gets precedence. This very well maybe the case already, but then why install stuff that's already available?


texts: with-slots with defstruct "class" instance

texts:
Is it possible to use a with-slots-type macro with an instance of a defstruct-defined class in emacs lisp? I tried and I'm getting this error:

eieio-oset: Wrong type argument: eieio-object, "some-string", obj.

Sample code:

(progn
  (defstruct testobj a b)
  (require 'eieio)
  (with-slots (a b)  (make-testobj :a 1 :b 2)
    (message "value: %s:"  (list a b))))


texts:
I like Emacs but I hate the default shortcuts. I'm trying to make them more like Sublime Text, Atom, ...
Most shortcuts I can change without a problem, but ESC seems to be more difficult. I don't wont to press ESC 3 times or C-g to exit something.
Can I remove ESC as a prefix key?

I tried this, but that doesn't work:
(global-set-key (kbd "ESC") 'keyboard-escape-quit)
It seems to break other shortcuts.

I use Emacs on Ubuntu 16, but I connect from Windows with putty. (I got all the function keys working under putty)


texts: How do I visit a file on a different branch?

texts:
I'm aware of C-x v ~ which allows you to see a different revision of the current file, but I would like to visit the file on another branch.

Is this possible with magit, VC or git-timemachine?


texts: Emacs segfaults after I run M-x package-install

texts:
I'm a Emacs newbie. I've gone through the guided tutorial and I got excited by what Emacs promises. I want to learn Emacs and use it as my primary development editor, and specifically at the moment for Clojure development with Cider.

When I type M-x package-install and hit enter to try and install Cider my Emacs just closes unexpectedly. I've tried several suggestions I found on this site and other but no luck so far.

Here's what I get on the terminal using --debug-init as a post I read suggested:

Backtrace:
/snap/emacs/296/usr/bin/emacs[0x58f0c7]
/snap/emacs/296/usr/bin/emacs[0x567cbc]
/snap/emacs/296/usr/bin/emacs[0x58e802]
/snap/emacs/296/usr/bin/emacs[0x58e7d3]
/snap/emacs/296/usr/bin/emacs[0x58e83d]
/snap/emacs/296/usr/bin/emacs[0x58e9f9]
/snap/core18/current/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fe670900890]
/snap/core18/current/lib64/ld-linux-x86-64.so.2(+0xcac8)[0x7fe677759ac8]
/snap/core18/current/lib64/ld-linux-x86-64.so.2(+0x150bd)[0x7fe6777620bd]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x6f)[0x7fe66fd642df]
/snap/core18/current/lib64/ld-linux-x86-64.so.2(+0x147ca)[0x7fe6777617ca]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(+0x1663ad)[0x7fe66fd633ad]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x6f)[0x7fe66fd642df]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(_dl_catch_error+0x2f)[0x7fe66fd6436f]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(__libc_dlopen_mode+0x89)[0x7fe66fd634d9]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(+0x148886)[0x7fe66fd45886]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(__nss_lookup_function+0x128)[0x7fe66fd46088]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(+0x105cf3)[0x7fe66fd02cf3]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(getaddrinfo+0x124)[0x7fe66fd04ce4]
/snap/emacs/296/usr/bin/emacs[0x671b31]
/snap/emacs/296/usr/bin/emacs[0x619809]
/snap/emacs/296/usr/bin/emacs[0x6194e5]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x61a30a]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x61a30a]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]

How can I fix this? I've tried:

removing and re-installing Emacs,
changing the Emacs init file

but none of that has worked.

Do you have any suggestions? What can I do to fix this?

As an aside note, I see a quick message Contacting host: melpa.org:443 before the crash happens so I changed my Emacs init file to see if it would fix the error, but no luck.

(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
;(setq package-check-signature nil)

; Set up melpa package repository
(require 'package)
(setq package-enable-at-startup nil)

(package-initialize)

(add-to-list 'package-archives
             '("gnu", "https://elpa.gnu.org/packages/")
             '("melpa", "https://melpa.org/packages/"))

Ideas and suggestions welcome and appreciated. Thank you.


texts:
In Emacs 27, in -nw mode at least which is what I use, I've found an issue with scrolling.
If you open emacs to see two files at once: emacs -nw -q file1 file2, and then scroll down the left window with your keyboard (the selected window by default), long enough to make the screen jump, when you scroll back upwards, the right windows will jump as well as if they were trying to move together. The offending behaviour can still be reproduced even if you change scroll-step to 1 or whatever.
If you, before doing the scrolling test, go to the other windows, or close and then split again the second window, or just open one file and the split the window to see the other file, the behaviour is correct.
It only happens when you open two files at once and start scrolling around before doing anything else.
Emacs25 hasn't this problem and I haven't test it in Emacs26 because of dependency conflicts.
How to fix it?


texts:
I'm aware of some way to set up my own custom mode in Emacs, but I'm wondering: How does it actually manage Mode (eg: Setting things up, then resetting them once exiting Mode, etc)?
I'm guessing it probably work in either of the following:

Using tempfile to remember state/Mode being used (either on disk or ram)
Setting up mapping for both exiting and entering a Mode (while making it so they can check if Mode is already used or not)

If it's neither of these, then How the inner working of Mode management is actually like?
I'm mainly curious about it because I'm trying to emulate that for another editor, and while I'm sure it's maybe out of scope for this SE, it probably isn't because I'm not asking how to do this, but merely how it actually work.


texts: Where is this `make-magit-section` function defined?

texts:
I'm looking at the magit source code, and there's this make-magit-section function that doesn't seem to found anywhere in the project (grep doesn't return any results).

describe-function says that it's defined in magit.el and that it has a compiler macro make-magit-section--cmacro. This macro has no results in grep as well.

Here's the one place it is being used in the magit repo https://github.com/magit/magit/blob/next/magit-section.el#L635

Where could this function be defined?


texts: How to remap backward-delete and help command while using Emacs from a terminal emulator?

texts:
I was using Emacs on CentOS 7 from the MobaXterm terminal on Windows 7, but the backspace key instead of backward-deleting a character invokes the prefix command C-h. According to EmacsWiki, I tried to put the following lines in ~/.emacs.d/init.el:

(global-set-key (kbd "C-h") 'delete-backward-char)
(global-set-key (kbd "C-?") 'help-command)

It does make the backspace act normally, but I couldn't invoke C-h by typing either Ctrl-Shift-/ or Ctrl-h, or find anywhere to invoke it. Did I miss anything? Is it possible to let both backspace and Ctrl-h act as usual, that is, backspace doing backward-delete and Ctrl-h doing C-h help command?


texts: How to execute a keyboard macro until termination inside another one, without stopping the recording?


texts: evil quit-window and evil-record-macro integration

texts:
I am trying to replicate emacs standard behavior when it comes to 'q', i.e. when in a buffer where insert mode does not make sense 'q' closes it. So I defined the following function

(defun evil-new-record-macro ()
  (interactive)
    (cond
     (buffer-read-only (quit-window))
     (t (evil-record-macro ?0))
     ))

But (evil-record-macro ?0) is a bad idea since it assumes a '0' as an argument and I don't know how to use without a pre-specified register.

The question is the following:

Whats a more correct/better way to approach the letter 'q' behavior, macros when it makes sense and quit when it does not.

BONUS: How I can fix the function so it does not need a register to be pre specified.

assume that I am always in normal state and switching to emacs or motion is not an option. I also use general.el to bind keys.


texts:
I have installed pdf-tools by melpha, and write a line in init.el file to load it. However, when I opened my pdf files I still couldn't view it and the error of "Error running timer ‘pdf-cache--prefetch-start’: (error "PNG image supported not compiled into Emacs")".
It seems that I didn't have PNG support. When I hit C-c C-c, it shifted into DocView mode. Could anyone give me some suggestions to solve this?


texts: How to run emacs function from the shell

texts:
I would like to:

run an emacs function from the shell
in a standard emacs session (configured as if it was run in an interactive session)
with a certain file in the active buffer

So I would like to do something like:

emacs --function org-beamer-export-to-pdf --file my-presentation.org

Bonus points if I can run it with the emacsclient, connecting to an already running emacs server.


texts: How to checkout ours/theirs on a file in magit?

texts:
Let's say I have a merge conflict. I see a conflicted file like this:

Unstaged changes:
    Unmerged   Foo/bar/wibble/plop/elbow.txt

I can hit tab here to open the changes and maybe jump to a point inside the file to fix by hand, but if it's a big file with lots of conflicts that can be time consuming.

How can I ask git, through magit, to checkout the ours or theirs version of the file, to resolve the conflict? I can copy the path, then use Shift-: to enter a custom git command, but it seems like there must be a keyboard shortcut for this. I can't see anything obvious in the magit menu or the ? pop-up.


texts: how to automatically adjust window size to buffer height?

texts: I want to optimize my gdb window setup. The idea is to automatically resize the gdb-breakpoints window to the current buffer length. In my setup this buffer is at the bottom and I want it to auto-resize vertically every time I add or remove a breakpoint.


texts: org html exporter case sensitivity of links

texts:
if I have an org file like this:

this is [[heading]]
* Heading

I can follow "Heading" with 'C-c C-o' so the link and the target are case insensitive.

However if I try to export this org file to html (org-export-to-html) I get this error:

  user-error: Unable to resolve link "heading"

which means that for html exporter the link and the target are case sensitive. Is there a way to make it case insensitive?


texts: Org Mode: org-lookup-* functions missing

texts:
The functions org-lookup-first, org-lookup-last, and org-lookup-all do not seem to be available to me. These functions are documented at the following link: Lookup Functions.

I can't look them up in the help system, and they don't work when I try to use the functions replicating tutorials. It seems like something is preventing these functions from being available. I don't think that there is anything in my config that would be doing this though. Does anyone have any ideas why this might be happening?


texts: Emacs on Windows: `shell-command` hangs when process wants input

texts:
I am using Emacs on Windows 8.

Some processes when run through shell-command will request interactive input, notably commands like git push (which will ask for user name and password). Sometimes I will accidentially run such commands synchronously (shell-command without &) and Emacs will just freeze. The same happened with some commands when I was using bzr.

After freezing, it will become impossible to resolve the issue from within Emacs – C-g and any other input is simply ignored – and I have to track down the executable in the task manager. This may be related to the password prompt of git, which even in Cygwin entirely ignores common signals (e.g. C-c).

Is there some fix for this behaviour? I can do  it for git push specifically with some function-advice for shell-command, but I'd rather find a general solution.

Workaround

For reference: My current solution is to add an advice to shell-command, that adds the forgotten ampersand &, detecting commands by regular expression.

(advice-add #'shell-command :filter-args #'shell-command-git-fix-advice)
(defun shell-command-git-fix-advice (args)
  (when (and
         (not (string-match-p "&[ \t]*$" (car args)))
         (string-match-p "^git +push +" (car args)))
    (setcar args (concat (car args) "&")))
  args)


texts: How do I tell the alert package to use growl on windows 7?

texts:
I would like to use the alert.el package for notifications on windows 7. Therefore, I installed growl for windows and I can trigger notifications by using growlnotify.exe.

When customizing the alert package, there is an entry:

 Alert Growl Command: c:/Program Files/Tools/growlnotify.exe

But when I evaluate (alert "This is an alert"), nothing happens... I see no way to say alert to actually use growl. What am I missing?


texts: Remove everything except match of regexp?

texts:
I have a file with a structure like:
some text and numbers and a final number: 1.213,31
some other number 1231 and text

again some text and a final number: 53,00
something else
again a final number: 1.233,54

Now I want to create a file looking like:
1.213,31
53,00
1.233,54

I can use higlight-regexp and the regexp [0-9,.]+$ to match the correct content, but I don't know how to remove the rest of the file or alternatively copy everything higlighted by this regexp into another buffer.
So how can I do this?


texts: Can't enter password when retrieving mail with mu4e

texts:
I am setting up mu4e with offlineIMAP.
I haven't written my password in any dot file so I have to enter it manually.
I can retrieve email from the console via offlineimap but when I try it from within emacs I can't make it work.
My .emacs file contains

(setq
   mu4e-get-mail-command "offlineimap"
   mu4e-update-interval nil)

(setq                         ;;for faster indexing see manual
  mu4e-index-cleanup nil      ;; don't do a full cleanup check
  mu4e-index-lazy-check t)    ;; don't consider up-to-date dirs

how to reproduce:

open emacs
M-x mu4e-update-mail-and-index
a) type 123abc enter
   letters trigger 'a is undefined', ...
   enter opens tutorial
b) click inside the '*mu4e-update*' buffer, type 123abc enter
   letters trigger 'a is undefined', ...
   enter triggers 'Buffer is read-only: #<buffer  *mu4e-update*>'
c) click inside minibuffer that says '[mu4e] Retrieving mail... |'
   *Messages* buffer gains focus
   type 123abc enter behaves as b)


texts: Pasting in evil-mode when there's an active selection copies the selection

texts:
Currently when I select a bit of text replacing another bit of text (eg "viwp" to paste over the current word) it copies the thing I just replaced into kill ring. So if I try to paste over another bit it has lost the original thing I copied and instead pastes the thing I previously replaced. Obviously I can cycle through the kill ring but that's fiddly and a total pain.

Any idea what variables to look at? I think this happened when I upgraded evil-mode.