texts:
When opening a vector icon text file for editing, Emacs first tries to display it as an image. That is wrong ; If the file has errors, Emacs (25.3.2 - x86_64-pc-linux-gnu, GTK+ Version 3.18.9) crashes miserably. Well, I know it has errors, that why I opened it in a text editor in the first place :/

And furthermore, Emacs will hang even if the file doesn't have errors, but just because it cannot render it (like it's just several paths with ids inside a svg grouping tag) which is frustrating to say the least.

How can I make Emacs load text files as text files and not try to render it (because it can't) unless I explicitly told him to?

PS - Yes, I know that I can switch to text-mode by pressing C-c C-c.

What I tried

(add-to-list `auto-mode-alist
             '("\\.svg\\'" . xml-mode))

But no, Emacs still crashes on me upon opening my icons.svg file because it tries to render it as an image (and it's actually several images) when actually it's not its job.

Annex: The SVG code

<svg xmlns="http://www.w3.org/2000/svg">
  <symbol id="cross" viewBox="0 0 20 20">
    <path d="M17.1 5.2l-2.6-2.6-4.6 4.7-4.7-4.7-2.5 2.6 4.7 4.7-4.7 4.7 2.5 2.5 4.7-4.7 4.6 4.7 2.6-2.5-4.7-4.7"/>
  </symbol>
  <symbol id="play" viewBox="0 0 15 15">
    <path d="M690 60H40l330 570L700 60z" />
  </symbol>
</svg>


texts: how to show latest xkcd in dashboard on startup?

texts: Dashboard can display images on startup. I was wondering how would I give it latest xkcd comic from xkcd-mode?


texts: How to get rid of the red areas and what are they?

texts:
I have some code I copy-paste from somewhere. What is this how to get rid of them all at once?

My emacs is setup to automatically cut the orange areas, but to get rid of these?

update:

             position: 16165 of 16950 (95%), column: 0
            character: TAB (displayed as TAB) (codepoint 9, #o11, #x9)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x09
               script: latin
               syntax:      which means: whitespace
             to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
          buffer code: #x09
            file code: #x09 (encoded by coding system undecided-unix)
              display: by display table entry [?→ ? ] (see below)

The display table entry is displayed by these fonts (glyph codes):
→: xft:-MS  -Consolas-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1 (#x365)
    : -- no font --

Character code properties: customize what to show
  old-name: CHARACTER TABULATION
  general-category: Cc (Other, Control)
  decomposition: (9) (' ')

There is an overlay here:
 From 16165 to 16165
  before-string        [Show]
  linum-str            [Show]

There are text properties here:
  face                 whitespace-tab
  fontified            t


texts: Viewing two areas of a file with different folding side by side

texts: In org-mode is there a way to view two areas of the same file in two frames/windows side by side such that folding and unfolding in the left frame/window is NOT reflected in the right frame/window?


texts:
In many editors it is standard to move selected text by dragging and dropping it with the mouse.

In emacs dragging selection with the mouse starts a new selection by default.

This is extremely annoying, as normally (everywhere else) such a behavior is achieved by clicking mouse to deselect text first. Besides, I cannot imagine a single use case for this emacs behavior - starting a new selection immediately after the first one without doing anything with the first selection.

How can I configure emacs to drag existing selection like in all other editors?


texts:
I am in the process of switching from Wanderlust to mu4e. I have multiple IMAP accounts and folders, and I used the "contexts" mechanism to configure each of them in their own specific ways. So far, everything is working fine.

However, there is one feature of Wanderlust that I miss within mu4e: a "Folder mode" buffer. This is a buffer which contains a list of summary information for each active IMAP folder that I am dealing with. I can navigate from one folder to the next simply by selecting its line within this Folder mode buffer.

The Folder mode buffer looks like the following example:

    - Email     :0/0/3745
        work        :0/0/190
        home        :0/0/803
        girlfriend  :0/0/2128
        misc        :0/0/624

The numbers represent new, unread, and total messages.

Has anyone constructed anything similar that works under mu4e? It doesn't have to be exactly the same. Instead of folders, it could be a list of contexts.

The main thing I'm looking for is a list of folders or contexts that I can choose from, with some message counts.

Anyway, at some point, I'm going to try to create such a thing for mu4e. But if something like this already exists, I don't want to go through the effort of reinventing the wheel.

Thank you very much for any suggestions.


texts: Mark heading done when all checkboxes are checked

texts:
I want to mark heading done when all items in the checklist are checked.
In this example :

* TODO Heading [2/3]
  - [X] Stuff 1
  - [ ] Stuff 2
  - [X] Stuff 3

When toggling Stuff 2 (C-c C-c) I want to switch the heading to DONE automatically.
Is there any org function to check if all nested checkboxes are checked?


texts: Preview Latex Fragment in org mode : blank square shown

texts:
I have an org file, where I put a LaTeX fragment to be rendered in line with C-c C-x C-l. It is a simple formula:

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

I have MiKTeX installed, latex and dvi commands work from command line in Windows without a problem.
I also have AUCTeX and preview of the same file (embedded in \begin{document} and stuff) works fine.

I get the following message in the messages buffer:

Failed to create dvi file from c:/Users/Michele/AppData/Local/Temp/orgtex6380KuB.tex
Creating images for entry...done.  Use `C-c C-c' to remove images.
Cannot find image file `c:/Users/Michele/Documents/ltxpnghome_5e3cd2413a24591c2b9e10c34d704b6effc5776a.png'

What to do next?

UPDATE

I have tried to change org-latex-create-formula-image-program to imagemagick instead of dvipng but got no luck. However, during my trials I opened the tex editor of MiKTeX to do some other, basically unrelated, testing.
While editor and package manager were open, I went to emacs and reverted back to dvipng and tried again C-c C-x C-l. At this point, I got a series of request to install missing packages!!
Guess what? When the requests ended (it was quite a few), everything was working fine and previews are now correctly displayed!

I have tried to trace back the last packages installed, they should be:

ulem, marvosym, wasysym, vasy

Hope this can help in a similar case.


texts: org mode export fails to add newline between heading 4 and broad text

texts:
Exporting to Latex PDF does not add a newline at the end of headings level 4.

Source:

* My one
** My one one
Plain text
*** my one one one
Plain text
**** my one one one one
Plain text
** My one two

Latex pdf output, see the inner heading, level 4:

I've read about org-blank-before-new-entry, but it looks like I'm looking for something after new entry of level 4.

Observing the generated LaTeX source, it turns out that level 4 is implemented by a \begin{enumerate} \item, that explains it.

How can I make org-mode add a newline after a header of level 4 or more?


texts: How to prevent the completion window from hogging up nearly whole frame (-3 lines)?

texts:
One or the other of the various Emacsen has been, at different times, my one and only editor on all *nix systems¹. I usually use one X window per buffer, so I can arrange windows side by side, or use windows manager shortcuts to switch. So, one file, one tall 80x55 window. Fig 1.

When I hit TAB in the window above, I'm getting this (Fig 2). The temporary completion window hogs up all but 3 lines of the frame. The same exact thing happens in any edit mode, as long as the completion list is long enough.

Nothing really drastic happens, any cursor movement command dismisses the unhelpful completion window, but I'm visually lost in the file for a moment: if I was editing near the bottom of the frame, the contents of the buffer scrolls up, and what I might have looked at is now above the top of window.

I suspect, but won't claim under sworn oath, this behavior is new to Emacs 24. Before that, the completion buffer height was visually about half of the window height. And, fellow Emacsierres, it's annoying enough that it makes me swear at times without any oath in sight.

It is also worth noting that the problem affects only temporary completion windows. For example, Help on function or variable pops up at the bottom, taking exactly 1/2 window height, just the way I'm used to (Fig. 3).

I tried:

Per this answer, customized window-combination-resize to t. Zero effect.
After digging some more, set temp-buffer-max-height to (lambda (buffer) (/ (- (frame-height) 2) 2))². The size it computes is quite sensible (27 for my 55-line buffer). Nope, nothing changed. What troubles me here is that the totally nebulous computation that I removed (see the note² for details) did not affect anything.

I should make it clear that my other displays have 100% scaling, aren't close to 4K high-DPI and other buzzwords, but still the completion want all but 3 lines of the window and messes up my scrolling position of the file I edit. So high-DPI is certainly not part of the problem. I'm just writing this question on the go, from that high-DPI laptop.

I'm out of ideas, really, thanks for any help.

¹ Coincidentally, albeit not very relevant to the point, I'm responsible for a lot of C ad .el code in the once-wannabe-competitor project, XEmacs, likely more than half of its MS-windows-specific part, in the mid 1990s when Emacs updates slowed to nil, so I'm not exactly a n00b; but some stuff I forgot, and some things changed in these 25 years beyond recognition. By now, I should grade myself a n00b+, no higher. Please bear with me.

² The original value from help.el

(lambda (buffer)
  (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)))
  (/ (x-display-pixel-height) (frame-char-height) 2)
    (/ (- (frame-height) 2) 2)))

was also sensible, but only as long as your font scaling is set to 100% on an MS Windows desktop. With a "high-DPI" laptop, the function produced nonsensical values. With my 200% font scaling, (x-display-pixel-height) returned exactly half screen pixel height, 1080 vs actual 2160, and (frame-char-height) 14 instead of actual 55, 4 times less--looks like the scaling was applied the wrong way, inconsistently, and twice. I do not know if this is an Emacs or the X Server issue, but anyway, I got rid of this bogus branch. I'm leaving this note for high-DPI users, just in case. Did me neither help nor harm, but was clearly wacky.


texts: Use special character in emacs init file with "global-set-key"

texts:
I want to be able to automatically insert pre-defined strings when pressing a certain keybinding. Currently this is being done with the following code snippet:

;;;;; Personal keybindings
(global-set-key [f6] "\autocite[--]{}")

The problem is, that this does not work (the one in the example). Instead,
Emacs will tell me "After 0 kbd macro iterations: Quit" which does not show up, when just doing the string without the "\". So how could I fix this and enter pre-defined strings which include special character such as "\"?


texts: orgmode read/source all options from a template file

texts:
i was wondering if orgmode had a simple way to read/source all options from a template file. for example instead of adding all this to every presentation file i create:

 #+OPTIONS: reveal_center:t reveal_progress:t reveal_history:nil    reveal_control:t
 #+OPTIONS: reveal_center:t
 #+OPTIONS: reveal_rolling_links:t reveal_keyboard:t reveal_overview:t num:nil
 #+OPTIONS: reveal_width:1200 reveal_height:800
  #+OPTIONS: toc:nil
  # #+REVEAL: split
  #+REVEAL_MARGIN: 0.1
  #+REVEAL_MIN_SCALE: 0.5

i would just source a file (txt or orgmode?) with all the pre definitions

any clue?


texts: How to programatically retrieve help strings for mode-line % constructs?

texts:
I'm looking for a way to programmatically retrieve documentation for
mode-line-format %-constructs; this is part of a little project I'm
working on to help with mode-line customization.  So for example, if
the mode line contains "%e", I want something ike:

(display-mode-line-format-percent-help "%e")

to return:

print error message about full memory.

Right now the only way I can think of is to parse the help string for
mode-line-format, but that seems like it would put me in a state of
sin.  :-)  Is there a better way?


texts: org mode - add formula to generate delta column

texts:
How can I get below result with org table formula? The number of rows maybe too many, so doing it line by line is not good way.

For example:

@1$2 = @1$1 - @1$1
@2$2 = @2$1 - @1$1
@3$2 = @3$1 - @2$1
...

| x | delta |
|---+-------|
| 2 |     0 |
| 3 |     1 |
| 5 |     2 |
| 1 |    -4 |
| 7 |     6 |


texts: Remapping several faces for use in minor mode

texts:
I'm using face-remap-add-relative in a tiny minor mode which, when activated, increases the size of the org-level-1 face. This function is perfect for that because when evaluated it returns a cookie that can be kept for later restoring the original size of the modified face. Here's the code:

(defvar bigger-org-headlines-cookie nil)

(make-variable-buffer-local 'bigger-org-headlines-cookie)

(define-minor-mode bigger-org-headlines
  "Increases the size of level 1 Org headlines."
  :lighter " Big-Org-Headlines"
  (if bigger-org-headlines
      (setq bigger-org-headlines-cookie
            (face-remap-add-relative 'org-level-1
                                     :height
                                     (expt text-scale-mode-step 1)))
    (face-remap-remove-relative bigger-org-headlines-cookie))
  (force-window-update (current-buffer)))

Now I changed my mind and want to increase the size of every headline in an Org file. In total there are 8 levels that need to be changed.

Is there an easier way besides changing face-remapping-alist manually (which BTW is not recommended)?

Suggestions are very welcome.


texts: Commenting out/disabling file local variable for input method in AUCTeX

texts:
I have the following local variables defined in a XeTeX file. As you can see, the input method is currently set to Devanagari. This is inconvenient when I want to type Roman letters. I'd like a way to disable that particular setting so I can then type Roman letters, and then re-enable it. I realise I can change the setting in Emacs, but it would be convenient if I could do so by commenting and uncommenting the file.

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% eval: (set-input-method 'devanagari-itrans)
%%% TeX-engine: xetex
%%% TeX-master: t
%%% End:

The question How comment out a variable line in a local variable list is related, but doesn't have an answer.

EDIT: I see that the question has been closed as a dupe of this question. I think the the two options provided in the question as at best workarounds. The first one doesn't even attempt to answer the question. The answer even says:

  I'm reasonably sure that you can't.

I was hoping there were some other options, at least for my use case - which isn't exactly the same as the other question.


texts: How can I find out which packages were not available?

texts:
When I run package-install-selected-packages I see the following message:

1 packages are not available (the rest already installed)

But it doesn't say which package was not available.

All the packages in package-selected-packages appear to have been installed, but apparently I requested something that was not available.

How can I find out what it was?


texts:
When I typed C-y to call yank, I got this.

apply: Symbol's value as variable is void: n
Debugger entered--Lisp error: (void-variable n)
ad-Advice-current-kill( ... [interprogram-paste-function interprogram-cut-function kill-ring kill-ring-yank-pointer yank-pop-change-selection 0 nil mapc kill-new error "Kill ring is empty" mod] 6 2016971] 0)
apply(ad-Advice-current-kill ... [interprogram-paste-function interprogram-cut-function kill-ring kill-ring-yank-pointer yank-pop-change-selection 0 nil mapc kill-new error "Kill ring is empty" mod] 6 2016971] 0)
current-kill(0)
yank(nil)
call-interactively(yank nil nil)
command-execute(yank)

The '...' in the traceback is messy code.
I have found it's this sentence that caused this error.

(require 'multiple-cursors)

The contents after querying function current-kill.

current-kill is a compiled Lisp function in `simple.el'.
(current-kill ARG1 &optional ARG2)
:around advice: `ad-Advice-current-kill'

And the contents after pressing ad-Advice-current-kill.

ad-Advice-current-kill is a compiled Lisp function.
(ad-Advice-current-kill AD--ADDOIT-FUNCTION ARG1 &optional ARG2)
Before-advice `interprogram-paste-for-all-cursors'.

It's really inconvenient that yank can't work. Hoping to solve it quickly, I post the source code for interprogram-paste-for-all-cursors
(defadvice current-kill (before interprogram-paste-for-all-cursors activate)
  (let ((interprogram-paste (and (= n 0)
                                 interprogram-paste-function
                                 (funcall interprogram-paste-function))))
    (when interprogram-paste
      ;; Add interprogram-paste to normal kill ring, just
      ;; like current-kill usually does for itself.
      ;; We have to do the work for it tho, since the funcall only returns
      ;; something once. It is not a pure function.
      (let ((interprogram-cut-function nil))
        (if (listp interprogram-paste)
            (mapc 'kill-new (nreverse interprogram-paste))
          (kill-new interprogram-paste))
        ;; And then add interprogram-paste to the kill-rings
        ;; of all the other cursors too.
        (mc/for-each-fake-cursor
         (let ((kill-ring (overlay-get cursor 'kill-ring))
               (kill-ring-yank-pointer (overlay-get cursor 'kill-ring-yank-pointer)))
           (if (listp interprogram-paste)
               (mapc 'kill-new (nreverse interprogram-paste))
             (kill-new interprogram-paste))
           (overlay-put cursor 'kill-ring kill-ring)
           (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer)))))))


texts: How to add several files to a fileset at once with a regular expression?

texts:
I'm working on the current branch of a game composed of several files. I have created a fileset so I can open all those files at once.  The GNU Emacs manual says:

  Normally, a fileset is a simple list of files, but you can also define
  a fileset as a regular expression matching file names.

However, no way to enter a regular expression to add files to a fileset is provided in the manual (filesets-add-buffer only allows you to add the file you are currently visiting).


texts: org-mode not showing entries with timestamp

texts:
I have the following entry in an org-mode file running emacs 26.3 freshly installed:
** lorem ipsum
   <2021-05-09 Sun>

When opening the agenda or clicking  the date there will be no entry in the calendar.
Why is this?


texts: Org-mode: Can't display inline images when openwith-mode is turned on

texts:
I use openwith to open images and a number of other types of files in external applications.

It works a treat, but gets in the way of displaying inline images in org-mode buffers: When I do C-c C-x C-v (org-toggle-inline-images) with openwith-mode turned on, the first image file linked in the current buffer is opened in an external viewer. The contents of the buffer itself don't change, i.e., no images are displayed inside the buffer.

Q: How can I stop openwith-mode from interfering with the display of inline images in org-mode?


texts: Where should I include a lazy initialization?

texts:
I want to add a specific key binding  to latex-mode:

(define-key latex-mode-map (kbd "<f6>") 'my-latex-defun)

At the same time I want to set it only when the specific mode is loaded. So I would like to know if there is a preference (best practice) between using the appropriate hook (latex-mode-hook) to accomplish that or using the clause (with-eval-after-load "tex-mode" ... to wrap the key binding definition. I tested both and they work fine, however I wonder which one is the right way to do it.


texts: Changing resolution in pdf-tools PDFView

texts:
See this solution for changing the resolution in DocView.

I don't see anything like this for pdf-tools. How can I increase the resolution like doc-view-resolution variable would?


texts: How can insert a yasnippet snippet not from the current major mode?

texts:
Sometimes I am editing multiligual documents (like jinja templates) and I just want to insert a snippet from something that is not in the current major mode. Furthermore, some document types don't have major modes and I don't want to have to bother to go off and make one or set variables to satisfy yasnippet. Is there a way just to look through all of the snippets to find the one I want?

I am imagining something where you run a command with a little path for disambiguating snippet names:

M-x yas-insert-snippet-from-all jinja2/if


texts: Lags when navigating vc-root-diff buffer

texts:
When I move around the buffer *vc-diff* from vc-root-diff I experience lags.
GNU Emacs 27.1 (build 1, x86_64-pc-cygwin) of 2020-10-29.
With procmon I detected lots of:
C:\opt\cygwin64\bin\git.exe --no-pager ls-files -z --full-name -- application.yml
C:\opt\cygwin64\bin\git.exe --no-pager cat-file blob 4f6e63900c275c7c53519ac0a2f6bc1cdd65abf8:application.yml

that generated for each new file in diff...
It is from vc-git-find-revision.
Even though I enabled debugging on entering that function Emacs didn't stop there, so I cannot get stack trace which hook is responsible to process spawning.
I want to disable that "feature".


texts: How can I find the current line and column ignoring text composition?

texts:
I'm working on a utility that communicates with an external process using line and column positions in the current file.

I have configured Haskell mode to use compose-region to display certain parts of the syntax in Unicode, which can replace multiple characters with a single one (ie turning -> into →). Unfortunately, this means that the line and column position in the buffer no longer correspond to their position in the underlying file, but instead map to the position in the buffer, counting the composed region as a single character.

Here's the code I currently use to get the line and column:

(list (line-number-at-pos) (current-column))

How can I get the position ignoring these composed characters, in terms of the underlying file?


texts: How to apply `org-mode` to files called `TODO` and also ending with `.org`

texts:
I want to apply org-mode by default into files called TODO and also ones that are ending with .org.
I have done following but neither worked. What might preventing to set org-mode by default?
(require 'org)
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)

(setq org-log-done t)
(add-hook 'org-mode-hook (lambda ()
                           (local-set-key (kbd "C-c s") 'org-show-subtree)))

(add-to-list 'auto-mode-alist '("TODO\\'" . org-mode))
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

(defvar no-flyspell-list '("TODO"))


texts: autocomplete popup menu broken emacs 24.5.1

texts:
I have recently encountered a problem with autocomplete when used together with linum. When I turn on the global-linum-mode, the emacs only shows part of the popped-up menu of candidates correctly. For example, after typing 'add' at line 11, several lines of the popup menu for autocomplete are blocked by white space after the first letter of the candidate words, as shown in the following figure:

After a few trials, I found the error occurs when the autocomplete is aroused if the word to be completed (in this case the word 'add') starts from the first or second column. In addition, to reproduce the error, the popup menu needs to be overlapped with some text in the document (there are text in line 12-18 in the example).

The following minimum configuration in the .emacs file can be used to reproduce the error:

(add-to-list 'load-path "~/.emacs.d/lisp")
(require 'auto-complete-config)
(ac-config-default)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(global-auto-complete-mode t)
(defun auto-complete-mode-maybe ()
;  "No maybe for you. Only AC!"
  (unless (minibufferp (current-buffer))
    (auto-complete-mode 1)))

(require 'linum)
(global-linum-mode t)
(setq linum-format "%4d")

I use GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-17 on lgw01-52, modified by Debian on a linux machine (Ubuntu 15.10).

Any help is appreciated and please feel free to let me know if my question is unclear. Thank you.

EDIT:
It seems that this is a bug in emacs 24.5, shown by the following link:

https://github.com/auto-complete/auto-complete/issues/402

In addition, the following error messages occur when the popup menu fails to show up completely:

Error running timer `ac-update-greedy': (wrong-type-argument wholenump -259)
Error running timer `ac-show-menu': (wrong-type-argument wholenump -120)

I will keep searching for solutions and update this question if I find one.


texts:
I have an Org mode file with the following source block in it:
#+begin_src sh :exports both
echo "first line"
echo "second line"
#+end_src

#+RESULTS:
| first  | line |
| second | line |

But when I export it as HTML, I get the following output:

I would like to export it so that the output is interleaved with the execution of each command:
$ echo "first line"
first line
$ echo "second line"
second line

How can I do that?


texts: emacsclient directly start eshell command command line

texts:
Both of the following work to call a graphical/terminal eshell:

emacs -f eshell
emacs -nw -f eshell

Furthermore, this 2-step process also works:

`emacsclient -t -a '' /some/real/file/name
Metax eshell

BUT, this does not:

emacsclient -t -a '' -f eshell

and fails with this error after lots of normal startup messages:

Error: server did not start correctly
Error: Could not start the Emacs daemon

Note: On my system, I use alias edt="emacsclient -t -a '' to make sure that I always end up in a daemon-backed emacs session server

How can I, in one command,

launch emacsclient
launch and display a new eshell
OR display an existing eshell frame?

If I could also suppress the top 2 "Welcome to EShell" lines, that would also be useful

EDIT: I found this way of launching emacs with eval:

emacsclient -t -a '' --eval '(eshell)'

, but this always selects the pre-existing eshell. How would I then get a "new" one?


texts:
In org, whenever I create a new tree and make a new line, the editor automatically indents only this first line (different behavior of older versions).
I'd like the editor to behave so that it does not automatically indent that first line.
I have org-indent-mode disabled.
Note from author: this question was extract from: How to remove first line indentation in org-mode, in the editor? #3872 made by @leonkis (Github). The reason why I put it here was because it was hard to find. Also, I copied the answer from @hlissner (Github) from here: https://github.com/hlissner/doom-emacs/issues/3872#issuecomment-684176505
2nd note: This behavior changed in Emacs 24.4, as you can see here.


texts:
I use Emacs with Evil mode, and I'm starting new line with key o.
But I prefer to stay in Evil's normal mode, without going into Evil's insert mode, when starting a new line.

When reading the called function for new line, I read this:

  o runs the command evil-open-below (found in evil-normal-state-map),
  which is an interactive compiled Lisp function in
  ‘elpa/evil-20171112.519/evil-commands.el’.

  It is bound to o.

  (evil-open-below COUNT)

  Insert a new line below point and switch to Insert state. The
  insertion will be repeated COUNT times.

So I thought to create a function that calls Evil's open new line function, then call Normal Mode. Like this:

(defun evil-open-line-in-normal-state (arg)
  (interactive "p")
  (evil-open-below arg)
  (evil-normal-state))

But it inserts a new line at the beginning, instead of new line aligned with the beginning of the text above.

Happily I found another implementation:

(defun smart-open-line (arg)
  "Insert an empty line after the current line.

Position the cursor at its beginning, according to the current mode.

With a prefix ARG open line above the current line."
  (interactive "P")
  (progn
    (move-end-of-line nil)
    (newline-and-indent)))

And Evil stays in the normal state. So everything was well. But after an upgrade to Emacs 27.0.5.0 with new packages, it breaks everything. It gives me a weird errors when starting new lines:

c-guess-basic-syntax: Wrong number of arguments: #[(containing-sexp paren-state) "Æ1\0bÇ1\0È`É\"b0\0\0ÊË
!^\0Ì1/\0È`É\"b03\04\0Ë
!^\0Í=\0Î1M\0È`É\"b0Q\0R\0Ë!^\0Ë
!\0Ï1k\0Ð`ÑÉ#0m\0Ê\0Ò`  ÓZ\"\0Í=\0`*0\0\0,Ô=\0'Ê()*+,+((-Ü\0-@:È\0-@A)-A-Í\0-@)-Ü\0-@(-A-bÕ(\"ì\0Ê¥\0Ö*×ÑØ)#.4ÊfÙ=4*Ö=4×ÑØ)#ÚUÊ.Ë.!#Ø.ËÛ!-Ö.Ê**Ö=ýÊfÜ=HÊ*ä,ZË,!ZÊ*äÊfÝ=äÞ*Þ=ä×ÑØ)#ÚUä/Ë/!ÊÞÔ=¥Êfß=¡ÊfÙ=¥`Sfß=¥ÊÞËà!¯ÞÞá=Ý`âÊx`01`Sfã=ÕÒ01\"?Õä ?+ÝÊÞØ*e*Ö=4×ÑØ)#ÚU4Ê*6*ÊfÜ=Ê¥\0(Ê)(¥\0åæ-!!`+ª\0+." [containing-sexp bracepos c-brace-list-key c-buffer-is-cc-mode csharp-enum-decl-re csharp-type-initializer-statement-re (error) (error) scan-sexps -1 ...] 6], 3

So I thought it was too difficult and time consuming to understand this C-syntax indendation error in PHP-mode when calling smart-open-line.

So I need to start again with the best simple approach:

(defun evil-open-line-in-normal-state (arg)
  (interactive "p")
  (evil-open-below arg)
  (evil-normal-state))

I'm out of ideas, frankly, to implement this while retaining the indentation from line above. What are the best options to retain the indentation when opening a new line?


texts: Why Emacs (dired+) asks me twice to delete file?

texts:
windows 10, Emacs 26.1, dired+

Suppose I want to delete (move to trash) file in dired mode.

D

Emacs asks me:

I press y

and now it's asking me again to kill file.

Why Emacs asks me twice?
I want to answer only once to delete (move to trash) the file.


texts: How to replace words in a region using iedit?

texts:
I want to replace some words inside a region. I would like to use iedit more than query-replace, but found the following problems (probably because I don't understand its documentation):

If I select a region, and then activate iedit, it takes the whole region as the text to change in the buffer.
If I don't select any region, it takes the symbol under point as the text to change in the buffer.

There's a function called iedit-toggle-selection, but I don't understand how to use it (by default in C-; and in Spacemacs in M-;). How do you replace, let's say two contiguous words, with some arbitrary text, inside a region (using iedit)?


texts: Projectile project in folder without write access?

texts:
At times I want to browse the code of projects to which I have read-only access.  This makes it impossible for me to drop a .projectile file at the root of the project.

Is there a way to define projects for use with projectile when I do not have write access to the project directories?


texts: What's the difference between ' (quote) and ` (grave accent)

texts:
I've seen both used to quote symbols and list.
What's the difference between them?
When should I use one or the other?


texts: Exporting scheduled date to latex from org mode

texts: When I export scheduled work to pdf using latex from org mode, scheduled date and time is not exported. How can I get them on pdf?


texts: Icicles: Why candidates are on the right side?

texts:
windows 10 , Emacs 26.1, Icicles

In my init.el

(add-to-list 'load-path "~/.emacs.d/elpa/icicles")
(require 'icicles)
(icy-mode 1)

And when I type the candidates are show on the right side.

Why?

Is it possible to candidates to show ABOVE mini-buffer?


texts: Orgmode export for latex and beamer using the properties drawer

texts:
Question: When exporting a subtree to latex and beamer with C-c C-e C-s, is it possible to use the properties drawer of a subtree to define the same properties as one would with #+LATEX_CLASS, #+LATEX_CLASS_OPTIONS, #+LATEX_HEADER?

The use case is having a single org file where you can write a file intended to be an article under one subtree, and another subtree where you write slides for a presentation.

My current setup uses #+LATEX_CLASS, #+LATEX_CLASS_OPTIONS, #+LATEX_HEADER to define the correct document class, options and packages to import when exporting with Orgmode. However, I cannot use the same values when exporting to beamer, the class is different, the options are different, and I may need to use different packages.

Thanks for helping! :D


texts: How do I make errors about url-domsuf-parse-file go away?

texts:
I am seeing it in connection with certain websites and eww.el.  Is there quick hack I can do to make those sites load?

The error I see is like the following:

error in process filter: url-domsuf-parse-file: Opening input file: \
no such file or directory, \
/Applications/Aquamacs.app/Contents/Resources/etc/publicsuffix.txt

I was using Aquamacs 3.2, the most recent at the time of writing.


texts: spacemacs flycheck: use specific linter for python

texts:
I would like to use a specific linter for python files in spacemacs. A coworker sent me an emacs code-snippet that should solve my problem, but doesn't seem to be loaded.

(add-hook 'python-mode '(lambda ()
                           (semantic-mode 1)
                           (setq flycheck-checker 'python-pylint
                                 flycheck-pylintrc "~/.pylintrc")))

I know it isn't loaded because when I load a (very poorly written file) it has the following error:

  Warning (flycheck): Syntax checker python-flake8 reported too many errors (826) and is disabled.

I am trying to use pylint with our specific lintrc file to get around this problem.

Edit: C-h v flycheck-checker says the value is nil. Also, it doesn't seem like I can set that variable at all interactively (with M-x set-variable)
Edit2: I can't seem to even disable flycheck, so if anyone knows how to do that, it would be great.


texts: How to configure the delimiter for evil-search-word for C/C++ modes?

texts:
Using evil mode, pressing * runs evil-search-word-forward.

But for some reason C/C++ mode uses _ as a delimiter, meaning ID_FOO will only match the first term ID when searching for the next term.

How to configure these delimiter characters?


texts:
I reinstalled my whole system and after trying to load my previous Emacs config that works in the past, I always obtain an error:
org-define-error and I follow de conflict line what is (require 'ox-beamer) but I can't find this package but in my last installation of Emacs it works. Anybody knows what's happening here?


texts: How to open 3 emacs windows when debugging using gdb

texts:
I am debugging a program that outputs 8 or more lines of display and requires input.  So my IO window has to be say 10 rows or so in height.  But I also want to see the source code AND of course the gdb input window.

What is the easiest way to present this?  To have 3 windows?  1 for gdb, 1 for console and the other for the source code?  If so how do I get 3 windows?

Or if I could somehow get the gdb io window to be a separate console window that might be even better.


texts:
After

% emacs -q

(split-window-right)
(scroll-bar-mode 0)
(fringe-mode 0)

there is still a pixel-wide line separating the two windows.  What is this
line called, and how can I change its width and colour?  Can I replace it with
a character such as |, as is used in the terminal?


texts: I came across notion.so and a couple of friends are using it in their firm. I was wondering if someone tried to make the todo in notion work with .org? The web wasn't really helpful in finding any solution out there


texts: Looping through re-seach-forward gives error

texts:
This program aims to restore the guile REPL session dump (see input file).

When I added the while loop, ELISP stated giving me this error when the end of the file is reacher:

Scan error: "Containing expression ends prematurely", 715, 716

Can someone please tell me what the problem is?

This is the program:

PROGRAM

(defun retore-guile-session()
  (interactive)
  (save-excursion
  (while (progn (re-search-forward "scheme@(guile-user)" (point-max) t))
     (append-to-buffer "scratch" (find-start-of-sexp)
                                 (find-end-of-sexp)))))

(defun find-start-of-sexp ()

   (re-search-forward "(" (point-max) t)
   (backward-char)
   (point-marker))

(defun find-end-of-sexp ()
  (forward-sexp)
  (point-marker))

And this is the input file?

INPUT FILE

GNU Guile 2.0.11
Copyright (C) 1995-2014 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)>
scheme@(guile-user)>
scheme@(guile-user)>
scheme@(guile-user)> (+ 1 2)
$2 = 3
scheme@(guile-user)>
scheme@(guile-user)>
scheme@(guile-user)> (+1 2)
ERROR: In procedure 1:
ERROR: Wrong type to apply: 1

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>
scheme@(guile-user) [1]>
scheme@(guile-user) [1]> (+ 1 2 (*
                 2 3))
$3 = 9
scheme@(guile-user) [1]>

Can someone please tell me, why is ELISP giving me error Scan error: "Containing expression ends prematurely", 715, 716 when the while loop reaches the end of the file?

Thanks in advance.


texts: Sorting words with hyphens (e.g. in a Lisp mode)

texts:
SortWords in the EmacsWiki suggests this function as a way to sort words:

(defun sort-words (reverse beg end)
  "Sort words in region alphabetically, in REVERSE if negative.
  When prefixed with negative \\[universal-argument], sorts in
  reverse.

  The variable `sort-fold-case' determines whether alphabetic
  case affects the sort order.

  See also `sort-regexp-fields'."
  (interactive "*P\nr")
  (sort-regexp-fields reverse "\\w+" "\\&" beg end))

However, it does not behave sensibly on words with hyphens. Here is an example. Before:

a-magician pulled the-rabbit out-of the-hat

After using sort-words (above):

a-hat magician of-out pulled-rabbit the-the

This is certainly interesting (in the Chinese proverb kind of way). I suspect it has to do with Destructive Sorting. (I get a lot of mileage from pointing out how strange that is!)

What is a reasonable way to improve sort-words above?

Update: Would someone care to explain (perhaps in a comment or an answer) why the implementation above behaves strangely (at least to my eye) with the hyphens?


texts:
I have an open buffer with major mode ansi-term, and with scrollback. This buffer has crashed.

I'd like to "recycle" the buffer into a new ansi-term such that scrollback is kept. How can I do this?


texts: How to replace a LaTex macro with its argument?

texts:
I want to replace a macro with its argument, that's to say, if I have

\newcommand{\foo}{FOO}

I want to replace every occurence of \foo with its argument FOO in a specified region.

I am trying to write a function in order to do this becasue I have to replace more than 100 macros:

(defun affil-name ()
  (interactive)

  (setq P0 (make-marker))
  (goto-char (point-min))
  (set-marker P0 (point))

  (setq P1 (make-marker))
  (goto-char (point-min))
  (search-forward "\\abstract" nil t)
  (previous-line)
  (set-marker P1 (point))

  (save-excursion
    (save-restriction
      (narrow-to-region P0 P1)

      (goto-char (point-min))

      (while (search-forward "\\newcommand" nil t)
        (setq pos1 (point-marker))
        (set-marker-insertion-type pos1 t)
        (forward-list)
        (setq pos2 (point-marker))
        (set-marker-insertion-type pos2 t)
        (forward-list)
        (setq pos3 (point-marker))
        (set-marker-insertion-type pos3 t)

        (setq cmd-name (car (extract-rectangle (+ 2 pos1) (- pos2 1))))
        (setq cmd-arg (car (extract-rectangle (+ pos2 1) (- pos3 1))))

        (perform-replace "\"cmd-name\""
                         "\"cmd-arg\"" t t nil 1 nil (point-min) (point-max))

        ))))

At the end of the loop, value of cmd-name and of cmd-arg are that of first occurence of \newcommand and there are no replacements.


texts: How can I set up Emacs so that all backups are placed into one backup folder? e.g. /MyEmacsBackups


texts: How to limit keybinds to normal mode and not to override keybinds in minibuffer?

texts:
I've keybinded &é"'... to selecting windows:

  (global-set-key (kbd "²") 'select-window-0)
  (global-set-key (kbd "&") 'select-window-1)
  (global-set-key (kbd "é") 'select-window-2)
  (global-set-key (kbd "\"") 'select-window-3)
  (global-set-key (kbd "\'") 'select-window-4)
  (global-set-key (kbd "(") 'select-window-5)
  (global-set-key (kbd "-") 'select-window-6)
  (global-set-key (kbd "è") 'select-window-7)
  (global-set-key (kbd "_") 'select-window-8)
  (global-set-key (kbd "ç") 'select-window-9)

However now everytime I need to type something in the minibuffer that contains those characters it tries to select those windows instead. How would I limit the scope of these keybinds only to the normal mode in buffers that are not the minibuffer ? Also when I'm in insert mode I would like those keybinds to just insert the characters.


texts: How to completely remove truncation symbol (default '$') from truncated lines when no fringes?

texts:
In a GUI Emacs without fringes, I would like to get rid of the '$' at the end of truncated lines such that lines can use the fill width of the window. I've tried:

(set-display-table-slot standard-display-table 'truncation 0) : this replaced $ with a space (or an empty slot).
(set-display-table-slot standard-display-table 'truncation nil) : this fall back to $

My question is thus how to display truncated lines without any truncation symbol on the right?
Here is a small mockup:
a) |Truncated lin$| -> Normal behavior
b) |Truncated lin…| -> Truncation symbol set to ?\…
c) |Truncated lin | -> Truncation symbol set to 0
d) |Truncated line| -> What I would like to obtain


texts: How to highlight back-tick quoted strings in code-comments?

texts:
Since back-ticks are often used for literals, is there a way I can highlight these in code comments?
So this:
# This is a comment, this is a literal: `4 + 4`.
# let's make things interesting (`literal_a`,`literal_b`).

Can display like this:


texts: In non-terminal Emacs, how do I make new frame open within the same OS window?

texts: Basically, I would like GUI emacs to replicate the terminal behavior, where a new frame is opened within the same (OS) window. This would work similar to vim's tabs, which are just a way to move around different window configurations within the same session.


texts: How to run shell scripts at startup of Emacs/EXWM?

texts:
I have configurations I would generally run on the startup of DWM. Now, I would like to do the same with EXWM/Emacs.
Is there any Elispian way to do it?


texts: Sort org-mode links by descriptive text?

texts:
I have a dozen org-mode links in the standard format.  How can I sort these by the descriptive text?

[[alink1][Baz]]

[[alink2][Foo]]

[[alink3][Bar]]

These are displayed like this in the buffer:

Baz

Foo

Bar

The result should be:

[[alink3][Bar]]

[[alink1][Baz]]

[[alink2][Foo]]

Which will be show as:

Bar

Baz

Foo

[Update]

When I do this: (setq org-descriptive-links t) then try M-x org-sort-list, I get error message: 'Wrong type argument: number-or-marker-p, nil'


texts:
When I do (require magit) I get following error.
Debugger entered--Lisp error: (wrong-type-argument sequencep all)
  cl-intersection((all magit) all)
  byte-code("\301\302!\210\301\303!\210\301\304!\210\301\305!\210\301\306\307\310#\203/\0\311\312\313\300!\205!\0\$
  require(magit-popup nil t)
  (if (require (quote magit-popup) nil t) nil (defalias (quote magit-define-popup-switch) (function (lambda (&rest$
  eval-buffer(#<buffer  *load*-52963> nil "/home/alper/.emacs.d/elpa/magit-20200829.1629/magit-obsolete.el" nil t)$
  load-with-code-conversion("/home/alper/.emacs.d/elpa/magit-20200829.1629/magit-obsolete.el" "/home/alper/.emacs.$
  require(magit-obsolete)
  byte-code("\301\302!\210\303\304!\210\303\305!\210\303\306!\210\303\307!\210\303\310!\210\303\311!\210\303\312!\$
  require(magit)
  eval-buffer(#<buffer  *load*> nil "/home/alper/.emacs" nil t)  ; Reading at buffer position 4190
  load-with-code-conversion("/home/alper/.emacs" "/home/alper/.emacs" t t)
  load("~/.emacs" t t)
  #f(compiled-function () #<bytecode 0x1e0f5d>)()
  command-line()
  normal-top-level()

I want to reinstall magit hoping it will resolve the error. But I am unable to do that because of the following error I am getting:
Package ‘magit-2.90.1’ is a system package, not deleting
[Q] How to delete/reinstall a system package?

The way I install magit:
(require 'package)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")))

(add-to-list 'package-archives
             '("MELPA Stable" . "http://stable.melpa.org/packages/") t)
(package-initialize)

(if (not (package-installed-p 'magit))
    (progn
      (package-install 'magit)))

(if (not (package-installed-p 'magit-delta))
    (progn
      (package-install 'magit-delta)))


texts: I can't get the most basic calc-mode gnuplot example to work

texts:
I would like to graph functions and datasets from calc-mode. (That's a reasonable thing to do in 2021, right?)
Following the directions at Basic Graphics and Vectors as Lists, I started calc-mode, created two vectors, and typed g f:
--- Emacs Calculator Mode ---
2: [0, 1, 2, 3]
1: [0, 1, 3, 9]
   .
g f

No graph is produced. In the *Gnuplot Trail* buffer that is created, I can see that I've got gnuplot v5.4 installed.
(BTW, TIL that the 'gnu' in 'gnuplot' has nothing to do with 'GNU', How did it come about and why is it called gnuplot?)
Also in the trail buffer, there are these error messages:
Terminal type is now 'qt'
gnuplot>
Terminal type is now 'unknown'
                      ^
         unknown or ambiguous terminal type; type just 'set terminal' for a list

gnuplot> gnuplot>
gnuplot> set notime
               ^
         "/var/folders/cj/hmr0n_q91kd7lg4jsqb8w9100000gn/T/calcAkJV7MZ" line 23: Unrecognized option.  See 'help unset'.

This makes me think I am using too new a version of gnuplot for the version of Calc I have installed. I am running vanilla Emacs 27.1. I couldn't figure out how to get Calc to tell me what version of calc-mode I have installed (including reading the source).
Searching site:emacs.stackexchange.com calc-mode gnuplot produced nothing of relevance.
I have once gotten the contents of various buffers like *Gnuplot Temp*, *Gnuplot Temp-2*, and *Gnuplot Commands*, saved them into independent local files, and run gnuplot from the command line and gotten a chart created, but I would like to figure out how to get things to work the normal way.
What should I do next?


texts: Adding a caption to an equation in org-mode

texts:
I'd like to add a caption to a LaTeX-formatted equation, using org-mode's build-in #+caption: directive. The manual says this is possible, but does not specify exactly how to format it. The most intuitive methods do not work; I tried all of the following:
#+caption: Kepler's third law
[\ T^2 = \frac{4\pi^2}{G(M_1+M_2)} \]

#+caption: Kepler's third law
#+latex: \[ T^2 = \frac{4\pi^2}{G(M_1+M_2)} \]

#+caption: Kepler's third law
\begin{equation}
T^2 = \frac{4\pi^2}{G(M_1+M_2)}
\end{equation}

All three of these formattings result in the equation being rendered, but not the caption. I know it is possible to insert captions directly using LaTeX, but I would like to use the org native method, which the manual says I can do. How can I do it?


texts: How to render latex expressions (not necessarily formula) inside buffer?

texts:
By preview-latex on can render latex formulae inside a tex buffer. The package px package renders latex formular inside an arbitrary buffer (see https://emacs.stackexchange.com/a/219/).

A similar question: How to render latex expressions (not necessarily formulae) inside buffer? For example to render something like \textbf{some text...}.


texts:
As I use emacsclient -nw -c in a terminal e.g. xterm -e emacsclient -nw -c, emacs hangs when I resize horizontally (to the minimum allowed by the wm). I can't no longer launch any emacsclient window, thus I should kill the daemon to restart it.

It seems to be the -nw option that causes the issue.

Any clue to avoid this?


texts: Asynchrony when collecting output in a process buffer?

texts:
I want to capture output from a process buffer. This is not a duplicate of How do I reliably get output from a process? because that questioner is presupposing comint and an architecture for a function that returns the output. My question is at a lower level.

My theory was to get the value
of point
before sending a command string to the process buffer, call that value p1; send the command; get the
new value of point, call it p2, then call (buffer-substring p1 p2) to get
the output.

My theory works when sequentially executed in the REPL in the
*scratch* buffer. The commands don't work when sequentially executed in a
progn or in a let*.

I started off doing my theory in a let*. I'm using shell just as an example, the real target is another interpreter, so async-shell-command won't solve my real problem.

(with-current-buffer "*shell*"
  (let* (( p1   (point))
         ( _    (process-send-string "*shell*" "date\n"))
         ( p2   (point))
         ( text (buffer-substring-no-properties p1 p2)))
    `((p1 ,p1) (p2 ,p2) (text ,text))
    ))

  ((p1 326) (p2 326) (text ""))

and it didn't work. I am evaling everything in the *scratch* buffer with
C-uC-xC-e, using *scratch* like a traditional
lisp REPL.

I unrolled everything into separate calls setting global variables to investigate
why it didn't work, and discovered that it DOES work if I run the commands
sequentially in the REPL:

Here, I execute each line independently and show
the output:

(setq p1 (with-current-buffer "*shell*" (point)))

  275

(process-send-string "*shell*" "date\n")

  nil

(setq p2 (with-current-buffer "*shell*" (point)))

  326

(with-current-buffer "*shell*"
  (buffer-substring-no-properties p1 p2))

  "date
     Sat Sep 15 10:47:38 PDT 2018

  ~ ⌚ 10:47:38
     $ "

That's great. My theory is not completely crazy. Now, package that all back up in a let*, just in baby steps.
First, just put it all  in a progn, so that instead of four
commands, I will just have one:

(progn (setq p1 (with-current-buffer "*shell*" (point)))
       (process-send-string "*shell*" "date\n")
       (setq p2 (with-current-buffer "*shell*" (point)))
       (setq text (with-current-buffer "*shell*"
                    (buffer-substring-no-properties p1 p2)))
       `((p1 ,p1) (p2 ,p2) (text ,text))
       )

  ((p1 473) (p2 473) (text ""))

Now it doesn't work.

To summarize: the commands work when sequentially executed in the REPL in the
*scratch* buffer. The commands don't work when sequentially executed in a
progn or in a let*.

There is some asynchrony going on that I don't understand and don't know how to
manage. The first call to point, the call that sets the value of p1, somehow
happens after the call to process-send-string, even though I explicitly call
point before calling process-send-string. p1 has the same value before and
after the call of process-send-string, and that value is at the end of the
buffer. There is no way that the first call of point can clairvoyantly know
what the value of point will be after processing the command, so the call of
point must happen after the call of process-send-string, or else some
magical updating is going on, or some kind of lazy evaluation.

My questions are:

(this is what I really want) What is the right way to collect output from a
command buffer?
Out of curiosity, what about this hidden asynchrony? How and where is it
documented? How could I work my way around it?


texts: Syntax highlighting in C++ fails in user-defined literals

texts: The C++11 way to separate the parts of a user-defined numeric (integer or floating point) literal with ' as e.g. in 1'500ms stalls parsing for syntax highlighting. I couldn't find anything on the net about this - my new team makes heavy use of this and I am the only Emacs user, so it is me who has to adapt. Is there a way to make the parser for C++ recognize the new syntax without too much hassle? See also: https://en.cppreference.com/w/cpp/language/user_literal


texts: Updating magit today gives me invalid face attribute

texts:
Updating magit this morning I now can't start things up, getting:

face-attribute: Invalid face attribute name: :extend

Anyone know what could cause and (hopefully!) fix this?


texts: How to disable flymake for files edited over network with TRAMP?

texts:
My flymake configuration

;; flymake
(require 'flymake-cursor)  ;; Hoover over error to show help message

;; use pyflakes for Python
(when (load "flymake" t)
  (defun flymake-pyflakes-init ()
    (let* ((temp-file (flymake-init-create-temp-buffer-copy
                       'flymake-create-temp-inplace))
           (local-file (file-relative-name
                        temp-file
                        (file-name-directory buffer-file-name))))
      (list "pyflakes" (list local-file))))

  (add-to-list 'flymake-allowed-file-name-masks
               '("\\.py\\'" flymake-pyflakes-init)))

(add-hook 'find-file-hook 'flymake-find-file-hook)

(add-hook 'python-mode-hook 'flymake-mode)

It works fine locally but breaks when I try to edit files remotely. I have no intention of fixing that, I'm almost not using it, how can I disable it?

Thanks!


texts: How to enable bracket navigation in evil mode?

texts:
Vim mode has [ ] keys to navigate brackets.

See this example.

Eg, selecting a comment block can be done this way in vim:

[/ v, %

Is this possible in emacs with evil mode?


texts: regular expressions: matching all words containing a specific list of letters

texts:
The regular expression \ws\|l\|d matches all words containing at least one of the letters s, l and d. What is the correct syntax to match all words containing all these letters? (like solid, dollars, etc).

I found the following cheat sheet on http://www.emacswiki.org/emacs/RegularExpression but I cannot find the AND operation.

  .        any character (but newline)
  *        previous character or group, repeated 0 or more time
  +        previous character or group, repeated 1 or more time
  ?        previous character or group, repeated 0 or 1 time
  ^        start of line
  $        end of line
  [...]    any character between brackets
  [^..]    any character not in the brackets
  [a-z]    any character between a and z
  \        prevents interpretation of following special char
  \|       or
  \w       word constituent
  \b       word boundary
  \sc      character with c syntax (e.g. \s- for whitespace char)
  \( \)    start\end of group
  \< \>    start\end of word
  \_< \_>  start\end of symbol
  \` \'    start\end of buffer\string
  \1       string matched by the first group
  \n       string matched by the nth group
  \{3\}    previous character or group, repeated 3 times
  \{3,\}   previous character or group, repeated 3 or more times
  \{3,6\}  previous character or group, repeated 3 to 6 times
  \=       match succeeds if it is located at point

  \ca      ascii character
  \Ca      non-ascii character (newline included)
  \cl      latin character
  \cg      greek character

  [:digit:]  a digit, same as [0-9]
  [:alpha:]  a letter (an alphabetic character)
  [:alnum:]  a letter or adigit (an alphanumeric character ()
  [:upper:]  a letter in uppercase
  [:space:]  a whitespace character, as defined by the syntax table
  [:xdigit:] an hexadecimal digit
  [:cntrl:]  a control character
  [:ascii:]  an ascii character

  \s-   whitespace character        \s/   character quote character
  \sw   word constituent            \s$   paired delimiter
  \s_   symbol constituent          \s'   expression prefix
  \s.   punctuation character       \s<   comment starter
  \s(   open delimiter character    \s>   comment ender
  \s)   close delimiter character   \s!   generic comment delimiter
  \s"   string quote character      \s|   generic string delimiter
  \s\   escape character


texts:
Already one year ago, I described a problem on github with polymode and unexpected indents. Since there was no answer there so far and the problem is really annoying, I ask here for ideas for a workaround of the problem:

I am using polymode like this for pycode environments in latex
documents:

(defcustom pm-inner/python   (pm-inner-chunkmode "python"
         :head-matcher "\\\\begin{\\(pycode\\|pythontexcustomcode\\|sagecode\\)}"
         :tail-matcher "\\\\end{\\(pycode\\|pythontexcustomcode\\|sagecode\\)}"
         :mode 'python-mode)   "python typical chunk."   :group 'innermodes   :type 'object)

(defcustom pm-poly/latex-python   (pm-polymode "latex-python"
         :hostmode 'pm-host/latex
         :innermodes '(pm-inner/python))   "latex-python typical polymode."   :group 'polymodes   :type 'object)

(define-polymode poly-latex+python-mode pm-poly/latex-python)
(add-to-list 'auto-mode-alist '("\\.tex$" . poly-latex+python-mode))

Now the pycode environment may have an optional argument for the
python session name, for example
\begin{pycode}[SessionName] a = 2 \end{pycode}
If I hit Enter at the end of a line, in the next line it automatically
adds some unwanted tabs like in the following screen cast:

In a pycode environment without optional argument however it works
as expected.
My polymode version is 20190624.1927 in emacs 26.1


texts: Changing the definition of the paragraph

texts:
I would like to change the definition of the paragraph in such a way that every line to be considered as a paragraph. As I understand from the documentation, one should change the variables paragraph-start and paragraph-separate for this purpose. I tried the following, but it doesn't work. (I have evaluated the following in the scratch buffer, but when using forward-paragraph, the usual definition of the paragraph is used by forward-paragraph).

(setq paragraph-start "\n"
       paragraph-separate "\n")


texts: How to set terraform language pack in spacemacs?

texts:
On the document, follow the guide set this item to ~/.spacemacs
dotspacemacs-configuration-layers
'(
  ...
  lsp
  (terraform :variables
             terraform-auto-format-on-save t
             terraform-backend 'lsp)

Also installed terraform-lsp as its steps.
GO111MODULE=on go mod download # Download the modules for the project
make      # Build the project. Alternatively run "go build"
make copy # Install the project

I ran M-x lsp-install-server didn't find the tfls item.
How to check ＊lsp-log＊?


texts: How to prompt for function use be used within a function?

texts:
Consider the following example function
(defun simple-function ()
  (dotimes (counter 10)
           (input-function)))

This requires input-function to be hard coded within the definition of simple-function. How can I have simple-function prompt the user for the function that they would want to use in place of input-function?


texts: Use xcape-like Control_L=Escape only in Emacs evil insert-mode?

texts:
I like the idea of xcape for exiting insert-mode by just quickly tapping Control_L, but I don't like how it leaves "unconsumed" escapes around in other modes, or in other programs/terminals, which mess up my flow.

(E.g. input is xargs █oldcommand and I'm about remove oldcommand with C-k, so I hit Control_L, then change my mind because I want to type "bash -c" first, but because of the escape that turns into M-b ash -c leaving me with ash -c█xargs oldcommand  instead of xargs bash -c█ oldcommand.)

Can Emacs itself handle lone modifier keypresses so I can have this only in evil insert-mode?


texts: Delete trailing whitespace when saving, except certain modes

texts:
How can I delete-trailing-whitespace when saving, except for certain modes? With this attempt, whitespace is deleted for all modes, including fundamental-mode, which I'm trying to avoid.

(add-hook 'before-save-hook
             (when '(not fundamental-mode))
               'delete-trailing-whitespace)


texts:
I tried to highlight lines that exceed 80 columns using whitespace-mode. Eventually didn't like that idea and removed that from my init.el. However, the whitespaces are shown as . and line ends are $ in the files that I edit. How can I get rid of that. I tried adding the following to the init.el file. But that doesn't work between restarted session.
(whitespace-mode 0). Every time I source the init.el by load-file it works but not otherwise. I am a newbie emacs user and getting my way around with emacs and lisp. Could any one suggest me how to troubleshoot this issue?


texts: How to change font size in code listings in Org-Mode/Beamer

texts:
I'd like to reduce the font size used for code blocks included in my Org-Mode/Beamer presenation.  What command(s) can I use so as only affect the content of the src block?

Here's a minimal working example: the code block is near the end:

#+TITLE:     <<title>>
#+AUTHOR:    Dave
#+EMAIL:
#+DATE:      <<date>>
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc toc:nil \n:nil
#+INFOJS_OPT: view:nil toc:t ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:
#+LINK_HOME:
#+XSLT:

#+startup: beamer
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [bigger]
#+LATEX_HEADER: \usepackage{pgfpages}
#+LATEX_HEADER: \pgfpagesuselayout{resize to}[letterpaper,border shrink=5mm,landscape]
#+LATEX_HEADER: \usetheme{Dresden}
#+LATEX_HEADER: \usepackage[utf8x]{inputenc}
#+LATEX_HEADER: \setbeamertemplate{itemize items}[default]
#+LATEX_HEADER: \setbeamertemplate{enumerate items}[default]
#+LATEX_HEADER: \institute{}

#+BEAMER_FRAME_LEVEL: 2
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)

* Presentation

** Code Example
*** Text
:PROPERTIES:
:BEAMER_env: ignoreheading
:BEAMER_col:0.5
:END:

- Text describing code
- More text

*** Graphics
:PROPERTIES:
:BEAMER_env: ignoreheading
:BEAMER_col:0.5
:END:

% LOOK HERE!
% I want the text in this code block to be smaller
#+begin_src python
import sys
import os
import super_cool_module

value=super_cool_module.evalauate(42)
#+end_src


texts: Next buffer command change when in the terminal window

texts:
I am totally new to Emacs and on this first day I am trying to do very basic stuff in emacs. I am stuck at switching buffers when there is a terminal window open (by using M-x term). The next buffer command changes from <XF86Forward> to C-c C-<right>. I tried to type Ctrl + c + Ctrl + -> on the keyboard, but it still doesn't work. What is the problem here?

P.S. I am using macOS Mojave and Emacs 26.1.


texts: Elisp how to tell if my cursor is inside an org-table?

texts:
I have some code that activates hydras based on modes.

I can do the following for org-mode:

(when (eq major-mode 'org-mode)
  (hydra-org-nav/body))

I would like to see if I'm in an org-table and call my org-table hydra.


texts: Idiomatic way to prevent a function calling itself in elisp?

texts:
If I have a function which needs to know if it's calling itself, what is an idiomatic way to check for this situation?
While I can always bind a symbol (with a name that's highly likely to be unique) with let, then check if it's declared in the outer scope, I'm not sure if this is the best way.
Is there a common convention for handling this case?


texts:
I'm creating a table with percentages and calculating a simple sum of a column. The only thing left is to show the result of the formula as a percentage.
Here is my MWE:
| Element |   $ |
| E1      | 35% |
| E2      | 65% |
|---------+-----|
| Total   |  1. |
#+TBLFM: @>$>=vsum(@2..@-1)

My question is: how can I show the result of the formula as 100% instead of 1?
The percentage  signs are important because the table will be exported to latex.


texts:
How can I prevent the height of a vertical cursor to be changed if I increase the line spacing? This is my .emacs setup
 (setq-default cursor-type 'bar)
 (setq-default line-spacing 1.15)


texts: I have emacs installed on linux machine, and for most times, I need to connect to the machine on my windows laptop, previous I use putty, but I found it has issue with emacs keybindings, some key bindings are blocked. Is there any ssh client tool on windows that can exactly send all the key events to remote linux machine just like I am typing on the remote machine?


texts:
What is the remote variant of call-process-region or an easy way to implement it?

I tried

(let ((fh (find-file-name-handler default-directory 'call-process-region)))
   (apply fh #'call-process-region ...))

But this fails with unsupported i/o primitive.

tramp itself (as part of emacs-25.2) has a tramp-call-process-region function which I tried to use in a way like

       (with-parsed-tramp-file-name default-directory v
         (apply #'tramp-call-process-region v ...))

But this seems to execute the process on the local machine.

Some packages implement the functionality manually by copying buffer content into a temporary file in the remote site and call process-file in it.  But code is non trivial.


texts: Why is js2-mode changing my indentation level when I type parenthesis

texts:
I'm getting started with some JS code in Spacemacs, and trying to get a good indentation level on my method chaining. The trouble is, once I've got an indentation to the place I want it, something (I'm assuming a function of js2-mode) re-indents the code to a different spot once I type an open paren.
Typing, good so far:
function renderChart(data) {
var x = d3.scaleLinear()
            .a-nice-indentation-level

Then I try to add an open paren and get re-indented elsewhere:
function renderChart(data) {
var x = d3.scaleLinear()
        .a-nice-indentation-level()

Here's a gif so you can see it in action:

Any clue what I can do to stop this from happening? Obviously auto-indentation is a useful feature when I'm starting a new line, but I'd rather it not happen mid-line when I've already got things to the place I want them. Thanks in advance!


texts:
I am new to Emacs and trying to set up octave so that it runs inside Emacs. I followed the instructions on the official website but it didn't work as Emacs threw a error

searching for program: no such file or directory, octave

Following the directions given on a similar question in stack overflow, I added octave in environment variables and the commandline launches octave without any issues but the problem on Emacs persisted.

I tried the solution given on this link but the problem persists.

My init.el file looks like this

(autoload 'octave-mode "octave-mod" nil t)
(setq inferior-octave-program "C:/Octave/Octave-5.1.0.0/octave.vbs")
(setq auto-mode-alist
      (cons '("\\.m$" . octave-mode) auto-mode-alist))

(add-hook 'octave-mode-hook
          (lambda ()
            (abbrev-mode 1)
            (auto-fill-mode 1)
            (if (eq window-system 'x)
                (font-lock-mode 1))))

(autoload 'run-octave "octave-inf" nil t)

And the error message is

searching for program: no such file or directory, C:/Octave/Octave-5.1.0.0/octave.vbs


texts: Make reftex-toc work with multiple files

texts:
I'm using Emacs 24.5 with AUCTeX and RefTex to edit a multi-file project. It consists of one main file with %%% TeX-master: t to mark as master. The 'slave' files all have %%% TeX-master: main to link them to the master file.

RefTex can correctly find the bibliography defined on the master file. However reftex-toc only works for the master file. On any slave file it shows only entries for that single file.

How can I make reftex-toc aware of multiple files so I can quickly jump into other sections of the document defined in other slave files?


texts:
I created a custom minor mode for my Wordpress projects:

(define-minor-mode wordpress-mode
  "Wordpress minor mode"
  :lighter " Wordpress")

(provide 'wordpress-mode)

And on my init.el I load the package, associate the minor mode to the major mode web-mode and enable yasnippets for this extra minor mode.

;; ---- Wordpress Custom Minor Mode --------
;; Loads Wordpress Custom Minor Mode Manually
(use-package wordpress
  :load-path ("~/.emacs.d/elpa-offline/wordpress")

  :init
  ;; Turn on `Wordpress mode and snippets when web-mode on.
  (add-hook 'web-mode-hook (lambda ()
                 (wordpress-mode 1)
                 (yas-activate-extra-mode 'wordpress-mode )
                 )
        )

 )

Just to clarify, everything works fine, but everytime I open Emacs I get an error:

Error (use-package): wordpress/:catch: Required feature ‘wordpress’ was not provide

I tried removing the lambda function and leaving just the load-path and enabling the minor mode by hand with M-x wordpress-mode. I still get the same error on Emacs opening.


texts:
There are at least a couple of packages dedicated to moving buffers around within a frame (buffer-move and transpose-frame are the ones I'm aware of), but I don't seem to be able to find anything to swap buffers between two frames. Does anyone have a nice way of doing this?

I primarily use emacs on OSX but would think there should be a good generic solution to this.


texts: How to I use my init file to have another file automatically load in a buffer at start of emacs?

texts:
I want this file to show up in a buffer when I start emacs:

E:\emacs\org\index.org

What do I put in my init file?


texts:
Ok, this is a noob question but I've digging into this enough that I think it's reasonable to ask :)

My question: In one's .emacs / init.el file, can one use require to load packages that were installed via the emacs package manager?  If so, how?

I've seen a lot of code that says (require 'package-name), where 'package-name is something like 'powerline or 'rainbow-delimiters.  The docs say that require basically tries to load the file, making sure not to load it twice.  load works by looking in all the dirs in the load-path variable.  This makes sense.

package-initialize goes through the list of installed packages and tries to run their auto-loads (and possibly defer further work) so that all the packages I've previously installed will work.  This makes sense.

My confusion comes from my init.el: even though I've got packages installed (I can both see the packages in the filesystem and everything works great if I run (package-initialize)) using require doesn't work.  Emacs complains that use-package isn't in load-path and I can confirm that if I don't call (package-initialize) that the load-path doesn't ilst ~/.emacs.d/elpa (or anything under it).

My question: In one's .emacs / init.el file, can one use require to load packages that were installed via the emacs package manager?  If so, how?
Do I need to manually add the directory to load-path?  Should this normally work and I probably broke something with my personal init.el?

Any help would be appreciated - I'm clearly not getting something about how require works (and many other things too, I'm sure :)  )

EDIT: My version: GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30

Also, I'm playing around with use-package and am running into the same problem - if I add the directory containing use-package to load path without running (package-initialize) first then use-package fails because it wants to use the package bind-key. bind-key is installed but not listed in load-path so emacs barfs at that point.


texts: How to prevent tramp locations from interfering in history?

texts:
I have an issue where if I try to perform some random Emacs operations such as org-capture, or renaming a file to a different (local) directory in dired, Emacs attempts to contact a different machine using tramp, presumably for some sort of auto-completion or history reasoning. This causes a lot of hanging and waiting, because the machine tramp is trying to connect to is not available.

How can I prevent Emacs from looking up tramp files/locations when I perform other rudimentary operations? How can I determine where and how Emacs is getting the idea that it needs to look inside a remote file/location for operations like org-capture and dired-do-rename?


texts:
I set the Alt Gr key on my keyboard as compose key in my system (Ubuntu 14.04) in order to type letters like éóèàùçü and so on. But when I am on Emacs and try to press the Alt Gr key, I have a message saying that:

<Multi_key> is undefines

Ho can I make it work? Thanks.

P.S. as I don't have enough reputation, I couldn't tag this post with more meaningful tags. So, please, if you want to suggest tags, you are welcome.


texts:
windows 10, emacs 26.1

Suppose in my.org I has text:

OwnerKey    OrganizationName    GUID

1111350    My TV    aaaaa561-4194-4441-9FA5-4D712B2659EE
3333363    My TV    Abbbbb61-4cccccc41-9ddddddd12B2659EE
4444445    My TV    A3B8F561-4194-4441-9eeeeeeeeeee659EE
5555579    UF-energ electr pers    1111CFD2-Bf444ffff-A985-CB060075D9F3
6666631    Ingineric SRL  36A92222233A2-4A91-9826-7DD4F444442D

I need to auto convert them to table.

select whole text
in menu tbl->Convert region

Result:

| OwnerKey | OrganizationName | GUID   |                                      |                                      |
|          |                  |        |                                      |                                      |
|  1111350 | My               | TV     | aaaaa561-4194-4441-9FA5-4D712B2659EE |                                      |
|  3333363 | My               | TV     | Abbbbb61-4cccccc41-9ddddddd12B2659EE |                                      |
|  4444445 | My               | TV     | A3B8F561-4194-4441-9eeeeeeeeeee659EE |                                      |
|  5555579 | UF-energ         | electr | pers                                 | 1111CFD2-Bf444ffff-A985-CB060075D9F3 |
|  6666631 | Ingineric        | SRL    | 36A92222233A2-4A91-9826-7DD4F444442D |                                      |

But it not correct. It must smt like this:

| OwnerKey | OrganizationName     | GUID                                 |
|----------+----------------------+--------------------------------------|
|  1111350 | My TV                | aaaaa561-4194-4441-9FA5-4D712B2659EE |
|  3333363 | My TV                | Abbbbb61-4cccccc41-9ddddddd12B2659EE |
|  4444445 | My TV                | A3B8F561-4194-4441-9eeeeeeeeeee659EE |
|  5555579 | UF-energ electr pers | 1111CFD2-Bf444ffff-A985-CB060075D9F3 |
|  6666631 | Ingineric SRL        | 36A92222233A2-4A91-9826-7DD4F444442D |

I suppose that is because in text has spaces. E.g in "My TV".

But how I can fix this?


texts: Using tramp and ESS-mode, how can I get the R interpreter to execute locally?

texts:
I use tramp to edit R files on a remote server. When I evaluate R code within ESS-mode, it starts an R interpreter on the remote machine. However, at the moment ssh -X to the server does not work, so any R command that produces graphics does not connect to my local X11 server.

Is it possible to configure things so that ESS launches a local R interpreter and, hence, graphics would be displayed locally?


texts: Is it possible to have buffers in layers?

texts:
In Emacs, can you get something like the following:

10 |int foo() {
11 |    int a = bar();
12 | 30 |int bar() {
13 | 31 |    return 10;
14 | 32 |}
15 | // Bar.h
// Foo.c

The idea is that instead of going to the definition, the definition is spliced in at the point. This would be very similar to the "Peek definition" feature in Visual Studio 2017.

Is it even possible to "layer" a buffer on top of another buffer like this? Further, is it possible to get viewport-style scrolling inside the "top layer" buffer (like an ordinary buffer)? If it is possible to do so, please attach a screenshot of the result in your answer.

I've tried searching for related terms but I've only bumped into (a) indirect buffers -- these don't seem to be what I'm looking for and (b) overlays -- these seem to be modifying the view of the current buffer, not putting in a new buffer.

To be clear, I don't want to open another pane by splitting the window; I know that is already possible today.


texts: How to act on the currently highlighted search result with evil mode?

texts:
When using evil mode search, is there a way to act on the currently highlighted search result by...

Converting it into a selection.
Treating it as a text object.
Having the ability to specify the end of the match when editing.

Example edits could be:

Delete the text.
Make the text upper case.
Change the text for something else.

This something I often want to do when the search is only part of a word, in this case operating on the word is editing past the part of the word I searched for.


texts: cscope-minor-mode not enabled for C in emacs 25

texts:
I'm using Emacs 25 on Ubuntu 16.04, after a while spent on Emacs 24. One thing that I've noticed changed in version 25 is, cscope minor mode is not enabled by default when I edit C files, while it was in Emacs 24 (I also checked that this is the case with C-h m, cscope is indeed present in 24 but not 25). I'm using xcscope-el that comes with Ubuntu 16.04 (version 1.1-1, as far as I can tell). I have to type M-x cscope-minor-mode whenever opening a C file, which is quite annoying.

I have very limited knowledge of Elisp and don't understand how minor modes are associated with major ones, any idea what's going on here, or how can I at least start to investigate why this happens?


texts: flymake : How can I modify/ignore syntax and styling rules?

texts:
I'm using elpy to code in Python, along with flymake to help with style/syntax checking.

The problem being that I have my habit, and I like to sometimes put 2 blank lines between methods of the same class, which inevitably triggers the following :

E303 : too many blank lines (2).

Now I'd like, or to have flymake ignore this specific error, or to edit the file where these rules are written, to trigger for instance a warning from 3 blank lines, and not 2.

How could I do that ?

Thanks.

Edit : I'm using GNU emacs 24.5.1 on Ubuntu 16.04


texts:
Here is an interesting discovery. Copy the following text into a buffer:

'hello world'
'नमस्कार नमस्कार'

One can see that there are four words, two on line 1 and two on line 2.

Emacs count these as six words! Two on line 1 and four on line 2!

In case if it matters, I am using Doom Emacs v 2.0.9, Emacs v 26.3.

How do I set things right?


texts:
I have Git 2.5.3 installed and am using GNU Emacs 24.4.1 on Ubuntu. I just installed Magit from MELPA:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
(package-install 'magit)

If I then try to use M-x magit-version RET to try to make sure it installed properly, Emacs helpfully tells me

M-x magit-version [No match]

But if I just type M-x magit- RET, I'm presented with a long list of Magit operations like magit-commit, magit-diff, etc. Everything seems to be all there except magit-version. How can I fix this?


texts: Is it possible to alias an internal command?

texts: Since I discovered multi-term, I use it exclusively over term or eshell. But, I'm lazy and would prefer to be able to simply type term to activate multi-term. Is this possible?


texts: Return System Notification When Long-running Comint Process Completes?

texts:
I often have long-running processes in comint shells (e.g. SQL or fitting statistical models, both usually via an R/ESS shell).

While they're running I navigate away and do something in another buffer, and try to remember to check-back periodically. I often check-back too soon, and then get distracted.

It would be ideal if I could write a function to trigger an informative system notification using notifications.el, whenever a process left running in a comint buffer completed (for any process, which, say, had already taken longer than 90 seconds).

How could I write such a function, to produce a system-notification such-as "A process in [buffer-name] has completed."?


texts: How to stop lsp-mode converting C/C++ includes into buttons?

texts:
When lsp-mode is enabled all headers become clickable (draw as buttons), underlining them making them slightly harder to read.

I don't need this since I can have a key bound to go to the header.

Is there a way not to highlight headers in C/C++ with lsp-mode?


texts: Turn on auto-fill-mode when editing a commit message with Magit?

texts:
I have tried:

(add-hook 'git-commit-mode-hook '(lambda ()
                                   (setq fill-column 72)
                                   (turn-on-auto-fill)))

In both cases, auto-fill-mode is not active in the COMMIT_EDITMSG buffer unless I manually turn it on with M-x auto-fill-mode RET.
Even when auto-fill-mode is turned on, I can still type past the 72nd character on the same line.

Also, correct me if I'm wrong but it seems both git-commit-fill-column and git-commit-turn-on-auto-fill are deprecated.


texts: Get the same/map bindkeys in shell mode, in particular CTRL-r

texts:
I am using emacs s 23.1.1.
I have started to really use in real-earnest the shell, in order to minimize the amounts of time I am out of emacs. However, the bind-keys are emacs based. Which is good, but has its' limitations. if I want to use CTRL-r in the shell-context (loop backward over commands input), and not in the emacs context, how do I do that? Having a preceding bind-key is O.K. I.e. press bindy key ALT-CTRL-S, and then CTRL-r.


texts: wcheck-mode: Add buffer local dictionary?

texts:
With flyspell-mode, one can maintain a buffer local dictionary. For example, I may middle-click "stackexchange" and select Accept (buffer). This adds the word to the dictionary at the end of the buffer:

%  LocalWords:  stackexchange

It would be nice to have the same functionality with wcheck-mode. Documentation for release 2014.6.21 contains example code for an "Add to dictionary" menu entry, but that's not buffer local.


texts: Workaround for "Invalid search bound (wrong side of point)" in CC Mode

texts:
Emacs 24.x and 25.x have a bug in CC Mode which can result in some operations failing with the error

  Invalid search bound (wrong side of point)

For example, I can reproduce it with the following file a.c:

#if defined(FOO) || \
    defined(BAR)

and running

emacs -Q -nw a.c --eval '(occur "FOO")'

(Running M-x occur RET FOO RET after that works. I have a bigger file where this doesn't work.)

This is a known bug: #28850. The fix is in two commits 46540a1c7adb1b89b6c2f6c9150fe8680c3a5fba and ad68bbd0da4ed90117f09dc2344c0c3d9d728851 which were first released in Emacs 26.1. I can confirm that Emacs 26.3 works with both the minimal example above and my real file.

The machines I use most often run Emacs 24.5.1 or Emacs 25.2.2, so I need a workaround for Emacs 24.x and 25.x. My init file has several hot fixes for Emacs bug and I'm fine with adding one more. I normally hot-fix in an eval-after-load form, either by advising a function or by replacing its definition.

But here there's a bug in the function c-make-font-lock-search-form which, if I understand correctly, is used at compile time. This is the relevant part of cc-fonts.el:

(eval-and-compile
  …
  (defun c-make-font-lock-search-form (regexp highlights)
    ;; this code needs to be patched
    …)
  (defun c-make-font-lock-context-search-function (normal &rest state-stanzas)
    (c-make-font-lock-search-form …)) ;; this call needs to be patched
)

(c-lang-defconst c-cpp-matchers
  t `( … ,(c-make-font-lock-context-search-function …)))

So cc-fonts.elc contains buggy byte-compiled code. Merely fixing the buggy function after cc-fonts.elc is loaded won't help. Even fixing the function before cc-fonts.elc wouldn't help.

How can I work around this bug? The workaround needs to work on Emacs 24.x and 25.x. The workaround needs to fix the "Invalid search bound" error, without disabling fontification. I don't mind if there's a slight loss of performance or accuracy compared to the official fix.


texts: How to align latex tables when using macro folding

texts:
I have a latex table which contains some long commands like includegraphics or href which makes the table very nasty to read.

To get a better view I fold all macros in the table and want to use align-current. However this doesn't work as expected as in the following MWE-screencast:

Align per se works as you can see in this demo:

How can I fix this? Is there a better way to get a nice few of my table?

The latex-fold-macros macro I use above is defined as follows:

(defun latex-fold-macros ()
  (interactive)
  (let ((macro (read-from-minibuffer "Macro: ")))
    (save-excursion
      (goto-char (point-min))
      (while (search-forward (format "%s" macro) nil t)
    (TeX-fold-macro)
    )
      )
    )
  )


texts: pdf-view-mode - pdfs documents are blinking/flickering on scroll

texts: I have small problem with pdf-tools - documents in pdf-view-mode are flickering/blinking on scroll. I am not well oriented about rendering, refreshing and all this stuff with pdfs. This is not about cursor blinking, etc. Anyone know how to fix it?


texts: Mu4e: How to keep the currently opened mail centered in the headers view?

texts:
When reading mail in the split headers/view in mu4e, is it possible to keep the currently opened mail centered in the headers view instead of at the bottom?
It would be nice to show some context on the mail thread even through mu4e-view-headers-next, mu4e-view-mark-for-trash or even mu4e-view-headers-next-unread


texts:
I have the following nested alist:
(setq x '(foo . ((bar . ((chocolate . "edible") (gold . "inedible")))
                 (jar . "glass"))))

How can get entry (chocolate . "edible")?
I read this question & and this
But unlike q1, I don't know the "path" to the value, and unlike, q2, I would like an Elisp
implementation. Also, I have a larger a list which can have a "depth" of 2 - 5 (by depth I mean alists in alists)
So far this is what I was able to cook up:
(defun assoc-recur (key list)
  (if (listp (cdr list))
      (assoc key (cdr list))
    (assoc-reccur key (cdr list))))

It's obvious that this code only works as long as the value is isn't a list of alists like (bar . ((..))
How can can I access a value in a nested alist with vanilla Elisp (without CL emulation)? Or should I give up and install the CL api and try q2?
The syntax I am looking for is something like (func key list)
ps: I am quite new to Emacs so I am probably missing out on a convenient function.


texts:
In an org-mode file:

#+BEGIN_SRC haskell
let x = "test"
putStrLn x
#+END_SRC

yields:

executing Haskell code block...
if: ‘org-babel-script-escape’ expects a string


texts: Is there a way to read the current displayed message?

texts:
Ignoring the *Messages* buffer which is used for logging messages, and which can be disabled, is there a way to get the current message displayed using Elisp?

Asking because there are times when it's impossible to use inhibit-message (because message is called from C, so I'd like to backup and restore the current message).


texts:
Is there any way to hide arguments of commands in proced? By default it shows processes like:

/usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3

I want it to be more readable by just showing /usr/bin/dbus-daemon.


texts: Getting auto-complete to work correctly in scribble-mode

texts:
I've been using Neil Van Dyke's scribble-mode for editing Scribble code in Emacs. I'm also using auto-complete and ac-capf to get better completion in scribble-mode. However, I've been running into a problem wherein I can't get auto-completion directly after an @ character in scribble-mode buffers. This is a problem because the @ character is an important part of Scribble's syntax. My current workaround is to type a keyword out and use a keybinding to auto-insert an @ before the word. However, this is becoming quite tedious and I would like to have normal-style completion instead. A very weird part about this is that pressing M-TAB (which runs the completion-at-point function) displays completion candidates in the *Completions* buffer, even  after an @ character, so I'm not sure why this isn't working with auto-complete / ac-capf. Here's a screencast demonstrating my problem.

So, my question is how can I get auto-completion to work directly after an @ character in scribble-mode?


texts: What's the org-mode syntax that tells LaTeX to place a float /here/

texts:
My images are floating much more than I'd like.  I'd like to force them to be where I tell them to be more like

\begin{figure}[!htb]
  \centering
   \includegraphics[width=0.75\textwidth, keepaspectratio]{./image.png}
\end{figure}

What I currently have is this, which does not seem to be doing it:

#+ATTR_LATEX: ::placement {!htb}{0.75\textwidth}
[[./image.png]]

What's the correct syntax to anchor my images where I say like exclamation point does?


texts: How to specify python to use in emacs on os x?

texts:
Basically, I am trying to have a good python development environment for sckit image and sklearn.

However, it seems to me the python version that runs in the emacs environment is different than the one in the system.

The main issue being certain libraries seem to be missing from the version on emacs when running this code

from skimage.viewer import ImageViewer
image = data.coins()
viewer = ImageViewer(image)
viewer.show()

I get these errors.

    >>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mods/Work/DR_Research/sample/imageProc.py", line 9, in <module>
    viewer = ImageViewer(image)
  File "/Library/Python/2.7/site-packages/skimage/viewer/viewers/core.py", line 194, in __init__
    init_qtapp()
  File "/Library/Python/2.7/site-packages/skimage/viewer/utils/core.py", line 29, in init_qtapp
    QApp = QtWidgets.QApplication.instance()
AttributeError: 'QtGui_cls' object has no attribute 'QApplication'

I have tried setting all sorts of variables from in the init-file py-shell interpreter, py-shell command, python-python command. I have tried appending the $PATH. All to no avail always the same version python 2.7.6 is being used in emacs

The same code runs normally on the os terminal. I only guessed that the different versions are the cause of the issue but it may be something else. I am kind of an amateur in python so detailed explanation is appreciated

Output of which python in os terminal

which python
/usr/local/bin/python

Python related stuff in init file

(setq python-python-command "/usr/local/bin/python")
(require 'python-mode)
;; (setq-default py-shell-name "/usr/local/bin/python")
;; (setq  python-shell-interpreter "/usr/local/bin/python")
(setq py-force-py-shell-name-p t)

; switch to the interpreter after executing code
(setq py-shell-switch-buffers-on-execute-p t)
(setq py-switch-buffers-on-execute-p t)
; don't split windows
(setq py-split-windows-on-execute-p nil)
; try to automagically figure out indentation
(setq py-smart-indentation t)


texts: Source-Links in Compilation mode not working

texts:
I've been experimenting with M-x compile recently (I'm using it to start my node.js-project which will output a stack-trace if there is an error.

I get traces like this:

Error: Configuration property "loggers" is not defined
    at Config.get (/home/myuser/path/to/project/node_modules/config/lib/config.js:179:11)
    at Object.<anonymous> (/home/myuser/path/to/project/lib/setup-logging.js:14:26)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/myuser/path/to/project/index.js:6:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

Each of the paths there is actually nicely clickable, however when I do click it (or navigate to it and press RET), emacs isn't smart enough to open the right file. Instead, I get a helm-popup saying Find this error in (default setup-logging.js:14): /home/myuser/path/to/project/directory/of/the/currently/open/file where I then have to navigate to the file myself.

I've looked through the docs but I couldn't find anything relating to this issue, can you guys help me out here?

PS: I'm actually using projectile-compile-project rather than compile directly, but I get the same results with plain compile.


texts: Use magit to display the difference between two branches

texts:
Is there a way to bring up a big list of the differences between specific commits across two branches?

I tried the method described in this answer but it came back empty, I assume because the revisions are on different branches.

I'll happily use another method if magit isn't right.

As clarification, this is the result I get from running d r from magit-status on the range 368513582b027bfde77cb2e9e43eace1b6f5336c..53ebfb70079bb5bc411fd0f8853673c2c5eb0589 which are across two branches (master and WW-pilot) and the branches are very different.


texts: Get Org Link Description From Table Column of Links

texts:
I have an org table and I want to take an existing column of org links of the form:

[[http://blah.com/blah/blah/foo][foo]]

And create an adjacent column containing only the description - i.e. foo.

For example using a made-up function:

#+TBLFM: $4='(get-description-from-link $3)

I've looked at How can I get all file links in one org-mode file? and also the function:

org-link-get-parameter

These seem to be doing roughly what I want, but rely on parsing a whole buffer, where I only want to deal with a single column in a single table.  Thus the function should take a link as a string of form [[link][desc]] and return desc.

The end goal is to make this a macro that creates the derived column, and copies its contents to another buffer, before deleting the derived column.  Most of this seems possible apart from the table formula.

Any ideas?


texts: I'm a newcomer to Emacs from Vim, I use rsjx-mode for react files.  Its major mode calls itself RJSX, but I would like to call it React, so how can I overwrite the rjsx package major mode name?


texts: Auctex's siunitx macro absorbs a backslash

texts:
If I insert \SI{50}{\m} into a latex file with auctex and LaTeX-environment doesn't insert the backslash before m, i.e. \SI{50}{m} instead of \SI{50}{\m}. However the backslash is required such that things like \SI{50}{\m\per\s} work.

Is this a bug or do I use this function in the wrong way? In the first case: is there a workaround? In the second case: Why does this behaviour make sense and how is the correct use in this case.

My auctex-version is 11.88.6 and my emacs version 24.5.1.


texts: Is possible to execute a key binding in a function?

texts:
Say, the C-M-j is bound to c-indent-new-comment-line for c-mode (and c++-mode) and indent-new-comment-line for other modes, but I want to define a function that will execute C-M-j to c-indent-new-comment-line in c-mode (and c++-mode) and indent-new-comment-line in other modes.

Is there any simple way that I can just embed the shortcut but not check the current major mode and then execute the different functions in defun...?

Example:

(defun example-fn ()
  (interactive)
  (beginning-of-line)
  (execute-C-M-j)
  (next-line))

The (execute-C-M-j) is what I want, execute the key not the command it is bound to, but I don't know how to implement this?


texts: with-temp-buffer removes text properties

texts:
Given e.g. (with-temp-buffer (clojure-mode) (insert ":hello") (buffer-string)), I'd expected the result to be propertized, however it isn't.

How to get a propertized string out of a temporary buffer?


texts:
I'm trying to calculate a new column on an org table, I'm using the following table formula:
#+TBLFM: $9=if (@# > 15, ($6-@-14$6)*100000/10724599, 0)
It's taking the difference on column 6 between the current row and 14 rows previous.
To prevent it from overrunning the start of the table the current row @# is checked to see there are 14 previous rows to look back over.  If not, a zero if filled in.
However when using this formula I get the message:
Row descriptor -14 leads outside table
But it shouldn't do that as it should only evaluate the true branch when there are >14 previous rows - at least that's what I thought?
In case Calc formulas don't respect short-circuiting with if, I tried a lisp construct too - but get the same result using if or when:
#+TBLFM: $9='(if (> @# 15) (/ (* (- $6 @-14$6) 100000) 10724599) 0);N
If I replace the -14 for -1 the logic doesn't fail - I presume, because of the header.
How can I achieve a lookback in a formula like the example above?
Note - if I comment out the condition that it testing for out of bounds indexes in org-table.el it works fine - which suggests org-table--row-type is being called eagerly on all parameters of if even if they are not used?  So perhaps I need to write my own lazy version of if or similar?
    (cond ;;((or (< i 0) (>= i l))
       ;;(user-error "Row descriptor %s leads outside table" desc))
      ;; The last hline doesn't exist.  Instead, point to last row
      ;; in table.
      ((= i (1- l)) (1- i))
      (t i))

If I then turn on debugging formula I can see what is happening for the first row - it does look to me like expansion of the out of bound array happens even though I never use it?
With out commenting out the code the debugging does nothing - I assume because the user error is hit before the debugger is started.
Substitution history of formula
Orig:   if (@# > 15, ($6-@-14$6)*100000/10724599, 0)
$xyz->  if (@# > 15, ($6-@-14$6)*100000/10724599, 0)
@r$c->  if (2 > 15, ($6-(Cumulative_cases))*100000/10724599, 0)
$1->    if (2 > 15, ((1)-(Cumulative_cases))*100000/10724599, 0)
Result: 0
Format: NONE
Final:  0

Update - it's not necessary to understand the problem but for reference the full code can be found here:
https://github.com/falloutphil/Misc/blob/master/covid.el