texts: pdf-tools asking to be rebuilt when emacs is started

texts:
My init.el file includes the line (pdf-tools-install)

Recently whenever I open emacs I get the message

"Need to (re)build the epdfinfo program, do it now" (y or n)
which is rather annoying.
I can't quite work out what to do in order to stop this from happening, and I can swear I remember this was not an issue when I originally set up pdf-tools. Has anyone come across this before, and/or know what to do?


texts: How to replicate the "~/"-to-home & "//"-to-root behaviour in ido-find-file but for a custom directory?

texts:
When calling ido-find-file it's possible to type ~/ to replace the current working directory with your home directory automatically:

Find file: /etc/{...} # after typing ~/ becomes:
Find file: ~/{...}

How can I replicate this but for a custom directory such as user-emacs-directory and when pressing a key instead of inserting text in the minibuffer? For example:

Find file: /var/log/{...} # after pressing F6 becomes:
Find file: ~/.emacs.d/{...}


texts:
I'm using powerline for my modeline and I have placed a clock within the modeline. This clock is only updating when I'm within that buffer, if I have another buffer up the clock freezes until that buffer is activated.

;;Initalise powerline mode line theme. Used with moe-theme

(use-package powerline
  :defer 5
  :config
  ;; Time & Date
  (display-time-mode)
  (defpowerline display-time display-time-string)
  (setq display-time-format "%H:%M")

  ;; Display battery
  (display-battery-mode)
  (defpowerline display-battery display-battery-string)
  (setq battery-mode-line-format "%L %b%p%%") ; "[%L %b%p%% %t]"

  (defvar lunaryorn-vc-mode-line
    '(" " (:propertize
           ;; Strip the backend name from the VC status information
           (:eval (let ((backend (symbol-name (vc-backend (buffer-file-name)))))
                    (substring vc-mode (+ (length backend) 2))))
           face font-lock-variable-name-face))
    "Mode line format for VC Mode.")
  (put 'lunaryorn-vc-mode-line 'risky-local-variable t)

  ;; Setup my mode line
  (setq-default mode-line-format
                (list "%e" ; print error message about full memory.
                      '(:eval (append
                               (list
                                (powerline-lcl             'left nil  )
                                (powerline-rmw             'left nil  )
                                (powerline-buffer-id       'left nil   powerline-color1                 )
                                (powerline-major-mode      'left       powerline-color1                 )
                                (powerline-minor-modes     'left       powerline-color1                 )
                                (powerline-narrow          'left       powerline-color1 powerline-color2)
                                (lunaryorn-vc-mode-line    'center     powerline-color2                 )

                                (powerline-pull-right (list
                                                       (powerline-row             'right     powerline-color1 powerline-color2)
                                                       (powerline-make-text       ":"        powerline-color1)
                                                       (powerline-column          'right     powerline-color1)
                                                       (powerline-percent         'right nil powerline-color1)
                                                       (powerline-display-time    'right nil )
                                                       (powerline-display-battery 'right nil)
                                                       (powerline-make-text       " "    nil)))
                                )))))

  ;; Remove the load
  (setq display-time-default-load-average nil)

  ;; Remove the mail
  (setq display-time-mail-string "")
  (setq display-time-use-mail-icon nil)

  ;; Turn buffer size off
  (setq size-indication-mode "")

  (setq visible-bell 1)

  (force-mode-line-update)
  )


texts: Interpretation of tabs in text copied from Emacs and pasted in other programs/editors

texts: When you set Emacs to recognize 4 spaces as 1 tab, then copy text from an Emacs buffer to another program, will the other program see 4 spaces or interpret it as 1 tab (which may correspond to a different number of spaces, depending on setup)?


texts: Exec format error when trying to run scripts from eshell

texts:
i get the following error no matter which simple bash script i try to run

emacs: /home/zeltak/bin/zbak.sh: Exec format error

all the scripts work great from bash/zsh

is this a known issue? cant you run bash scripts from eshell?


texts: How do I stop tab from being electric in Text mode?

texts:
When editing a plain-text document in Text mode when I press tab emacs inserts spaces until the cursor appears directly beneath the beginning of a word it finds in the line above.
I don't want it to do this. What I want is for the tab key to columnise the cursor position and therefore to align the cursor with the next preset tab-stop, ignoring text in the preceding line, much as a conventional mechanical manual typewriter does.
What setting do I need to change for tab to behave like a conventional manual typewriter in Text mode?


texts: Exporting org file breaks when upgrading to orgmode 8.3

texts:
My orgmode was recently updated to the recent 8.3, and I found that I can't export my init.org file as HTML any more.

I'm getting the following output in *Messages* buffer:

org-babel-exp process emacs-lisp at line 34...
org-babel-exp process emacs-lisp at line 44...
org-babel-exp process emacs-lisp at line 51...
... hundreds of lines like these ...
apply: Wrong type argument: listp, #("John's Emacs Config" 0 19 (:parent (#0)))

It seems that's it's having trouble parsing some of the headers. I tried removing the TITLE and AUTHOR headers and it was able to export.


texts: Keeping only the lines with the cursors in multiple-cursors

texts:
Say we have a file with several cursors. Not all lines have cursors, but every cursor is on a different line.

How can I kill all the lines without cursors? I couldn't find a single mc command for this, but maybe there is a still a way to do it with the other commands?


texts:
When I export an .org file to .odt, it changes my em dashes (---) as expected (which is great for HTML). However, the .odt file in this case needs to retain standard manuscript format em dashes ( -- ) unfixed. Basically a space, two hyphens, and a space.

Trying to get this result:

In org mode: Application of em dash here---looks like that.

Export to LibreOffice: Application of em dash here -- looks like that.

If possible.


texts: Find external definition with gtags or ggtags

texts:
Using gtags.el or ggtags.el.

I have a project A depending on project B.  While in a buffer belonging to A, I want to jump to a definition in B. How do I do this with ggtags-mode ?  M-. simply lists the occurences in project A.


texts: How to make org agenda `follow-mode` show heading (not timestamp line)?

texts:
I like to browse history of org file with follow-mode.

With old Emacs version 24.5.1 (org version 8.2.10), it showed timestamp line in highlight status when I browse.

But with recent Emacs version 26.3 (org version 9.1.9), it shows heading only (not timestamp line) when I browse.

There's no specific agenda related thing for my Emacs configuration. Even though I've googled for days, I cannot find any clues. I just found one guy's posting that he had same problem. But there's no answer.

What should I do, to use follow-mode like in old Emacs version? Any Emacs configuration, related about it?


texts:
I got these lines:

;; turn on semantic
(semantic-mode 1)

;; define a function which adds semantic as backup to auto-complete
(defun my:add-semantic-to-autocomplete()
  (add-to-list 'ac-sources 'ac-sources-semantic))

(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)

From this video here.But for me it does not work at all.Save me please,i lost all day fighting with it...


texts: (require ) a certain file only when opening a particular file type

texts:
I've started using Emacs for Ocaml programming, and used opam for installing some Emacs scripts which enable IDE features. To use these, opam added the following line to my .emacs:

(require 'opam-user-setup "~/.emacs.d/opam-user-setup.el")

However, this line makes the Emacs startup super sluggish. I use Emacs for a lot of things, and most of the time do not need this file at all. So I was wondering if there is a way to configure Emacs to require this file just before loading Ocaml files, and not always at startup.

Thank you!


texts: I am using a custom theme (doom-citylights) and the size of the font for lines that are bullets in org-mode is a bit too big. Is there a variable I can set within my configuration to reduce this specific font size?


texts: How to treat underscore as part of the word?

texts:
I use Emacs + evil mode.

When I position the cursor on e (in normal state) in a chunk of text such as abc_def_ghi, ciw (change inner word) changes only the def part of the string, while Vim would change the entire abc_def_ghi.

How can I force evil to treat the underscore as Vim does (ie, as part of the word)?


texts: orgmode: File not fully loaded into buffer

texts:
When I try to open an *.org file that I have previously created and saved, Emacs only displays the first line of the file in the buffer. I load the file with C-x C-f. I witnessed this behavior for org files only. When I open the org file with another editor (sublime, notepad, etc...) the whole data is there so the file itself seems fine.
Could not find any documentation on this behavior.


texts: Strange encodings in ORG mode with German umlaute

texts:
I have a few org files encoded in UTF-8. Everything works fine, also with German umlaute (ä, ö, ü, ß). These files I sync with Git between different PCs (mostly running Debian). When I synced one of the files with a windows machine it showed strange encodings in my Debian machine.

Example should be:

  via operations called „push“ and

But shows:

  via operations called \342\200\236push\342\200\234 and

where \342 and all \XXX are counted as one character.

The characters which make problems are: Ä,ä,Ö,ö,Ü,ü,ß,„,“,/,–

I tried to encode with C-x C-m c <encoding> RET C-x C-w RET in UTF-8 but this produces the error, that it couldn't be encoded with UTF-8. I only can use raw-text or no-conversion.

What can I do to encode back to UTF-8?

Thanks for your help.


texts: How to send few chars to shell buffer automatically/periodically

texts: I would like Emacs to send a few chars (command, ideally) to a specific buffer (ssh shell) so that the session does not terminate. How can I achieve this?


texts: What does the (interactive ...) form mean?

texts:
I want to write a function that will write the output of wc -l <file-name> next to each file in dired mode.
I got to this point:

(defun my-dired-insert-add-wc (beg end)
  (save-excursion
    (goto-char beg)
    (while (< (point) end)
      (condition-case nil
          (when (dired-move-to-filename)
            (shell-command "wc -l *")) ;; <--- `shell-command` contains what I need
        (error nil))
      (forward-line 1))))

(advice-add 'dired-insert-set-properties
            :after #'my-dired-insert-add-wc)

Now, running this outputs wc -l * into another buffer. So I decided to read shell-command to see how it works internally.

There are two things I dont understand:

What role does this program play in the shell-command function?
I mean, I understand that it read  from the mini-buffer, but where is that fed into? Like, it's not an argument to anything else. So how does the rest of the program uses it? It's right in the beginning of the function shell-command:

(interactive
   (list
    (read-shell-command "Async shell command: " nil nil
            (let ((filename
                   (cond
                (buffer-file-name)
                ((eq major-mode 'dired-mode)
                 (dired-get-filename nil t)))))
              (and filename (file-relative-name filename))))
    current-prefix-arg
    shell-command-default-error-buffer))

Where does the variable command gets it's value?
It doesnt seems to be assigned to anywhere.

(call-process shell-file-name nil
      (if error-file
          (list t error-file)
        t)
      nil shell-command-switch command)

So, to recapitaluete, I want to write the number of lines each file has in a dired buffer. I have written a small program that does something like what I want but the downside is that it outputs it into another buffer instead of the dired buffer. So I went to study the function shell-command to learn more about how to achieve my goal. I now have two question about the function shell-command.

Can someone please answer my two questions about the shell-command?


texts: how can I set a Python virtual environment in any shells (open, or that will be opened) based on changing projectile project

texts:
I'm using Projectile and pyenv-mode (https://github.com/proofit404/pyenv-mode).

pyenv-mode has projectile integration to update the virtual environment while switching projects. This is the code to do so:

(defun projectile-pyenv-mode-set ()
  "Set pyenv version matching project name.
Version must be already installed."
  (pyenv-mode-set (projectile-project-name)))

(add-hook 'projectile-switch-project-hook 'projectile-pyenv-mode-set)

I've enabled this code in my init.el. I'm not sure if or how this is supposed to integrate with shells (ansi-term and shell specifically), but I am trying to achieve the following:

When switching to a new project

switch any open shell buffers to the new python venv (can clear the buffer if required)
ensure than any wheel buffers opened while in a project also activate with that virtual env

What actually happens is that I get my default system Python in these shells at all times, unless I manually activate a virtual environment from in one of them.


texts: How to change style of hyperlinks within PDF published from org-mode document?

texts:
I'm exporting (publishing) an org-mode document to PDF, and the results look great except for the hyperlinks. They look terrible.

Hyperlinks to the Web look the same, only with a pale blue outline. How can I control the style of links in the exported PDF document? (I don't know LaTeX, but can make simple configuration changes in LaTeX if necessary).


texts:
I want to create clickable image links in org-mode. This would be equivalent to:

Currently, I can display inline image previews just fine, with [[path-to-image]] followed by org-toggle-inline-images. What I would like to do now, is add support for [[path-to-file][path-to-image]].

Any ideas?


texts:
I have been using emacs for many years, but from version 26 ... there is a mess with server as I have to type emacsclient in place of simply emacs. Going worse with 27.
From 26 I haven't found a way to disable server mode ...
From 27 emacsclient allows me to open only one session at a time ... I received message showing type CTRL # when you have finished ... while the file I try to open in another shell is asking me to Wait.
It's not fine at all.
How can I get the old behaviour ? I don't need server mode by default. I just need that emacs -nw opens my file without messing ...


texts: Can you directly open the Org Mode manual in the Emacs client?

texts:
In your Emacs client you can find the Org Mode manual landing page, as seen online, in a roundabout way:

C-h r
m Org Organizer RET
f (org)Agenda Views RET
u

Is there a way of opening the Org Mode manual/info with fewer keystrokes?


texts: What is the difference between kill-ring-save and copy-region-as-kill?

texts: These two commands seem identical to me. What am I missing?


texts: Defining the window pointed by "other-window"

texts:
In emacs, more often than i like, I end up with 4 windows or more.

I'll use that example:

+--------|-----------+
|        |           |
|   1    |   2       |
|        |           |
+--------+-----------+
|    3   |     4     |
|        +-----------+
|        |     5     |
+--------+-----------+

Lots of function can do action in other-window (usually same window pointed by C-x o). Specially useful are scroll-other-window. However, when 4 or more windows are opened, other window is unlikely to be the one I want.

Is there a easy way to manage to do set other-window without changing window/buffer layout ? Of course, it's doable using a bunch of C-x 4 b and C-b but I do not want to change the layout.
For example:

if editing in window 4 in above picture, is there an easy way to set C-M-v to scroll the window 1?
Or simply, suppose the the focus in on window 3 , how to set other-windowto point to window 2 ?


texts: Got "fatal: no tag message?" error when set git core.editor to "emacsclient -nc"

texts:
When I set the core.editor="emacsclient -nc", after I press "C-c C-c" in the  .git/TAG_EDITMSG buffer, I got the error message:

fatal: no tag message?

But here is the content of .git/TAG_EDITMSG file

test

#
# Write a message for tag:
#   v0.0.5
# Lines starting with '#' will be ignored.

I have tried to set core.editor to emacs or gedit -s, they all work fine. TAGS are created.

Emacs: compiled from git commit "ecb069e"
Git  : 2.6.2
OS   : Ubuntu 14.04


texts: R in ESS outputs UTF-8, which emacs renders raw

texts:
I find the question but no answer at Emacs ESS R - Message Content Encoding and Display Issue.

In buffer *R*, the R process uses UTF-8 encoding for its output.  However emacs does not decode that output, but displays it as-is.  E.g., I see this:

> install.packages("devtools")
Installing package into â\200\230/home/brech/R/x86_64-pc-linux-gnu-library/3.0â\200\231
(as â\200\230libâ\200\231 is unspecified)

Obviously the cryptic looking â\200\230 and â\200\231, which represent the code points "left single quotation mark" and "right single quotation mark" should look like single quotes.  I'd be happy with '.

BTW, \200 \231 and \230 are rendered as €, ˜, and ™ in Chrome.

So is there a way to either have R not UTF-8-encode, or to have emacs decode and render it legibly?


texts: A function which acts differently depending on the last keystroke

texts:
I would like to define a function which behaves differently depending on the last keystroke. More specifically I would like that it behaves differently if the last keystroke (before the execution of that function) has been <home>. Like below

(defun foo ()
  (interactive)
  (if (the-last-keystroke-is-home)
     (message "yes")
    (message "no")))


texts: How to make hyperlinks clickable in markdown mode?

texts:
In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.

Is there a way for markdown mode to have active hyperlinks as well?


texts: Techniques for rendering rotated text in emacs?

texts:
What techniques exist to render rotated text in emacs?  By this I mean physical rotation of text by an arbitrary angle and shown inline in a buffer as shown here:

(alignment of text in my sample is not significant)

Inserting an SVG image containing the rotated text comes to mind, but that is subject to emacs being built with SVG and naturally it wouldn't enable text selection.  Maybe it could still accommodate search if shown as an overlay.

I'm open to any suggestions.  Even limited solutions are highly relevant.  For example: if emacs could rotate individual glyphs/characters, but only rotated by 90 degrees or mirrored that would still be plenty useful!


texts: How can I remove an incompatible package?

texts: I recently checked my package menu, and found a large number of packages labelled incompat. I can't delete them by typing d on the package menu or running M-x package-menu-mark-delete. Are these packages installed but ignored? If they are present on my system, how do I go about deleting them?


texts: Regex to replace subset of repeated pattern

texts:
ABC、DEF, GHI, JKL、MNO
PQR、STU, VWX、YZ

How do I replace all , s with 、 in the repeated pattern above?
The repeated pattern can be mapped with the regex below:
"^\\([A-Z]+、\\)\\(\\([A-Z]+\\), \\)+"

However, because the ,  is a subset of group \\2, even though it can be separated from its preceding letters in the regex,

there is no way to replace it using replace-regexp without some form of nested group code. Also, DEF,  doesn't seem the match like GHI,  and STU,  with the regex.
(replace-regexp "^\\([A-Z]+、\\)\\(\\([A-Z]+\\), \\)+" "\\1\\2、")

What's the right way to do this, then?

Update:
@jue's answer below resulted in this:


texts: How can I make Emacs enter a TAB character when I press the TAB button, without modifying my config file?

texts:
I am looking for a command I can enter that will make the TAB key input an actual TAB character.

I'm open to anything that is temporary or that will not stomp on TAB mappings that do things other than indenting the cursor (like autocompletion etc).  i.e. any or all of these cases would be great to know about:

It can be permanent and affect all major modes as long as it will not affect anything other than indentation of the cursor.  (AFAICT, any permanent changes require an edited config file, but maybe I'm wrong about that.)
It can be permanent and affect just the current major mode as long as it will not affect anything other than indentation of the cursor.  (Again, maybe permanent change options shouldn't be on this list because I do not want to achieve this through config file editing, but maybe there is another way to make permanent changes that I haven't come across yet.)
It can be temporary and affect all major modes.
It can be temporary and affect only the current major mode.
It can be temporary and affect only the current buffer.  (I am unclear on whether an option change like this would persist if I then switch the buffer to a different major mode.)

I have found similar questions here but none that quite hit the mark.

This question is almost the same but missing my caveats, and the only answer says it risks clobbering useful TAB mappings.  can TAB behave like M-i?
This question is different but hits on a great idea, and could even sidestep the useful mapping clobbering issue (if C-q TAB or even M-i could stand-in for TAB for any useful TAB mappings), but it has no answers at all.  Translate TAB with C-q TAB
This question kind of deals with the global risk issue but the only answer looks like a config file edit.

Side note:  I am completely baffled by the way the TAB key works in fundamental mode and in text mode.  It tries to indent to align with the start of the next word...OK...but it sometimes skips words, and, much worse, successive indentations end up leaving clusters of space characters amongst tab characters (the space characters are completely useless if they come before tab characters, and they make deleting indentation more difficult since there are extraneous characters to delete).


texts: orgmode sync beamer with header in orgmode file

texts:
I am creating my beamer presentations with orgmode and convert the file to tex and pdf when saving. This works quite fine.
What I am looking for is that the pdf (seen inside emacs with pdfview/pdf-tools) file syncs the slide number which is shown with the corresponding header I am having my cursor on.
Does someone have a hint how to achieve this?
I am using spacemacs-develop (but Ithink that this is not so relevant here).
Thank you in advance!


texts: Arbitrary length lists as argument for interactive function

texts:
Say I have a defun with a dolist inside that I want to be able to pass a string that is then converted to a list with a length equal to the number of words in said string via the minibuffer, so something like:

minibuffer:
list: arg1
or
list: arg1 arg2 arg3 arg4

and just run the loop 3 more times

I have:

(defun some-function (&rest args)
  (interactive
    (list (some-function-to-read-multiple-arguments-as-a-list)))
  (dolist (arg args)
    (some-function)))

I assume it's very trivial, but I've not been able to find anything in the docs about it.


texts: Prevent Emacs from scrolling past the last line

texts:
Obviously Emacs never scrolls "above" the first line of the buffer. By contrast, it shows a bunch of empty space after the document if you scroll to the last line:

I want to make the bottom line behave the same way; essentially similar to this question:

Note that I'm not asking for a way to prevent the window moving past the document end entirely

except I am asking for exactly that. Naturally it can't be helped if the document is shorter than the screen, but scrolling doesn't happen in that case anyways.
My scrolling setup:
(setq-default redisplay-dont-pause t
              auto-window-vscroll nil
              scroll-margin 10
              scroll-step 1
              scroll-conservatively 101
              scroll-preserve-screen-position 1)

Am I right in feeling this can controlled by some variable, or do I have to modify the code from the question above?
Edit: It seems I was not clear enough in my original question. Here is a short video demonstration of the behavior I mean. Notice how when getting within the scroll margin at the top of the document, Emacs prevents movement above the document, but at the bottom it just pads the document with empty space.


texts: How to set face to different property by detecting the background-mode

texts:
(set-face-attribute 'hl-line nil
                      (cl-case (alist-get 'background-mode (frame-parameters))
                        ('light ; darker percent 5%
                         :background (color-darken-name (face-background 'highlight) 5)
                         )
                        ('dark
                         :background (color-lighten-name (face-background 'default) 3)
                         ))
                      )

The upper code does not work. I hope some one can correct this code.


texts: Direct emacs that open file from the pwd from shell buffer

texts: I use shell mode, often. I use the c-xc-f. Most of the time, the start directory for looking for file, correspond to the PWD of the emacs shell buffer. Can i set that it is always the case/or reset it?


texts: how to direct spaceline to display "Narrowed" in the mode-line?

texts:
I'm using Spacemacs, which by default includes spaceline. I'd like the mode-line to indicate whether I'm in a narrowed buffer or not. So when I do org-narrow-to-subtree, for instance, spaceline could display Narrowed.

How can I direct spaceline to display "Narrow" in the mode-line?


texts: dumb-jump finds all references instead of definitions

texts:
Example code:

typedef int my_type_t;

my_type_t a;

my_type_t my_function(my_type_t in)
{
    return (my_type_t) 0;
}

int main(void)
{
    my_type_t b;
    a = my_function(b);
    return 0;
}

When I run dump-jump-go on my_type_t, it finds all references to the type, instead of the type definition:

This is not what I expect after reading the documentation. The same happens with functions: definitions, declarations, and calls pop up.

Installing the dumb-jump package from elpa gave the following warnings, but I'm not sure they matter:

dumb-jump.el:1475:1:Warning: Unused lexical argument `proj'
dumb-jump.el:1622:1:Warning: Unused lexical argument `config'
dumb-jump.el:2251:1:Warning: Unused lexical argument `cur-file'
dumb-jump.el:2300:1:Warning: Unused lexical argument `exclude-paths'
dumb-jump.el:2300:1:Warning: Unused lexical argument `lang'

In end of data:
dumb-jump.el:2372:1:Warning: the following functions are not known to be defined: ivy-read,
    helm-build-sync-source


texts: automatically open new buffer in new frame

texts: I use tiling window manager and usually prefer it to handle emacs frames instead of using emacs windows. Is there a way I could force emacs to spawn new buffers in new frames automatically? Ideally this behavior should be toggled via some command.


texts:
Some programs, like many terminal emulators and gVim, hide the mouse pointer as soon as the keyboard is in use. Obviously, this is helpful when the mouse pointer happens to obscure some text behind it.

Is there a way to make Emacs do the same? (Running version 26.0 in X under Linux, if that makes any difference.)


texts: How to detect if in the current buffer some text is selected (marked)?

texts: How to determine if in the current buffer some text is selected?


texts: Trouble adding post-self-insert-hook in define-minor-mode

texts:
I am trying to write a minor mode that upon visiting a word, it manipulate it. There is a list of words which is parsed from a file. Here is the problem:

(define-minor-mode auto-gls-mode
  "Documentation goes here"
  :lighter " AGLS"
  ;(setq agls-list '("foo" "bar"))    <----------works
  (setq agls-list (agls-parse-acn-file)) <-------doesn't work
  (if auto-gls-mode
      (add-hook 'post-self-insert-hook
        'agls-check-word nil t)
    (remove-hook 'post-self-insert-hook
         'agls-check-word t)))

and the hooked function:

(defun agls-check-word ()
  "Check if the word is in the list"
  (if (= last-command-event 32)
      (do-some-stuff)))

The agls-parse-acn-file is pretty long but in pseudo-elisp reads like this:

(defun agls-parse-acn-file()
  ;find-file-noselect
  ;while new-line
    ;extract keywords
    ;end
  local-list)

simply opens a file by find-file-noselect, parse it, extract keywords and return a list. The conundrum is that, if populate the list as pointed by arrow the function in add-hook get called properly. If I use populate the list by calling the parse function, as I type in buffers with minor mode activate, nothing happens (agls-check-word is not called)


texts: Not able to load a color theme from 'init.el' or using 'M-x color-theme-select'

texts:
I am trying to get emacs(emacs24) to load with another colortheme (looking to have a 'dark' theme). In my init.el file I have the lines:

(eval-after-load "color-theme"
'(progn
 (color-theme-initialize)
 (color-theme-hober)))

When I load emacs, nothing changes. I have also tried  ‘M-x color-theme-select’, ‘M-x color-theme-select-hober’, and ‘M-x color-theme-select-robin-hood’ and I have a no match message.

I have also tried to include in my init.el file (eval-after-load "color-theme" '(color-theme-robin-hood)). I am able to include the julia-mode file so the placement of the init.el file seems to be alright. I have seen that there are some installation steps, but do not know if they are needed.

( I have also followed the instructions in link. I have also included in my 'themes' folder various folders to load for a theme, here is my init.el file currently)

(add-to-list 'load-path "./")
(add-to-list 'load-path "~/.emacs.d/")
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(require 'julia-mode)
(tool-bar-mode 0)
(menu-bar-mode -1)
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)


texts:
I am trying to use the code from this answer:
Is there a generic toggle-previous-window function?

(defun switch-to-last-window ()
  (interactive)
  (let ((win (get-mru-window t t t)))
    (unless win (error "Last window not found."))
    (let ((frame (window-frame win)))
      (raise-frame frame)
      (select-frame frame)
      (select-window win))))

I had to add: (select-frame-set-input-focus frame) to make it work. But with this code or just switching windows using the mouse I have the following problem. Imagine I have two frames, one with one window f1_w1 and the other with two windows f2_w1 and f2_w2. When I switch from f1_w1 to f2_w1 there is no problem, but when on the next cycle after f2_w1 -> f1_w1 I switch from f1_w1 to f2_w2 I can see the cursor first appear on f2_w1 and then quickly jump to f2_w2 making my last visited window f2_w1 and not f1_w1 as it should be.

EDIT: as per Drew's comment below that asks for the question. I just find it surprising that Emacs can't properly track the last selected window (unless something is messed up in my configuration). It seems that get-mru-window works as expected but switching to a window on another frame seems to be a two step operation under the bonnet, where Emacs selects the previously active window on the target frame (not the one I am switching to) and then quickly jumps to the one I am selecting. Is this behaviour unavoidable when using multiple frames?


texts: Converting nested lists to org-mode lists

texts:
I need to convert all nested lists present in buffer to org-mode headers using elisp. How can I do this?

1.2.7.2 Some Header Name -> **** Some Header Name


texts: How can I pass arguments to absolute links using 'file:' in orgmode

texts:
In org-mode (note I am running Windows), when creating a link using C-c C-l, using the following path loads my email software when clicking on the resulting link:

file:c:/Program Files/The Bat!/thebat32.exe

So far, so good.

However, when adding an argument to the executable emacs complains the file does not exist, for example clicking on the resulting link for

file:c:/Program Files/The Bat!/thebat32.exe argument1

yields an error message "No such file". It appears emacs/orgmode is checking if the file exists using an absolute path including the argument, hence not finding it.

Is there any way to properly pass arguments to simple file calls? Or would one need to create a new hyperlink type as described in http://orgmode.org/manual/Adding-hyperlink-types.html?


texts: Font and frame configuration in daemon mode

texts:
In my .emacs I have
(set-frame-font "Source Code Pro")
(set-face-attribute 'default nil :font "Source Code Pro" :height 140)
(set-face-font 'default "Source Code Pro")

Which sets the fonts to source code pro.  To do its job, this code apparently needs to run once after the first frame has been created.  How can I achieve that?

I'm on MacOS and use emacs-plus.
Emacs Deamon is started on boot as a service, I only ever call emacsclient.
If I run this code once, all new frames have the right fonts.
If Emacs Daemon restarts, I need to run the code again, but after the first frame has been created.
Putting it in .emacs runs it too early so it's not working.
If I start emacs as emacs, not as the deamon, the code in .emacs works and the first frame uses Source Code Pro.

How can I set the fonts or other frame parameters on deamon start?


texts: Emacs main window unresponsive after file save and loss of focus until menu operation

texts:
I'm running Emacs build GNU Emacs 23.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.23) of 2014-11-27 on x86-010.build.bos.redhat.com on Exceed On Demand (X windows).   The following scenario happens to me almost every time I perform it:

I save changes in the current buffer
I click on another window and Emacs loses focus
when I return focus to the Emacs window, the text buffer is unresponsive to keystrokes, the text cursor does not blink, and the only thing that breaks Emacs out of this frozen state is to activate a menu bar (simply popping up a menu bar and then dismissing it by clicking on the text buffer is all that's needed).

It's driving me crazy, any ideas of how to diagnose this or fix it?


texts: debugging segmentation fault when using `prin1`


texts:
I am having enormous difficulties typing lisp code in Portacle, is a complete IDE for Common Lisp based on Emacs. It is trying to get cute whenever I enter a " or a ). Sometimes it breaks my code.

Scenario 1.

I had the following in the clipboard.

(substitute-in-file-name "${SystemDrive}/opt

I pasted this at the end of a line that already had the following text.

((file-directory-p

The result was the following line of text.

((file-directory-p (substitute-in-file-name "${SystemDrive}/opt

I then typed a " at the end of this line.

Portacle escaped the " so that the final result was as follows.

((file-directory-p (substitute-in-file-name "${SystemDrive}/opt\"

Portacle does similar nonsense when I try to type ).

How do I get " to simply put a " where my caret is instead of getting cute.


texts: How can I get RET to follow org-mode links when using evil-mode?

texts:
In org-mode, the link-following behaviour of RET, that should be present when org-return-follows-link is set, doesn't work in evil-mode.

MWE from emacs -q:

Load an org buffer containing a link. Note that RET is bound to org-ret, but doesn't follow links. [Expected]
Set org-return-follows-link.  Hit RET when point is over a link. Emacs follows the link. [Expected]
Enable evil-mode. Note that RET is now bound to evil-ret, and no longer follows links. [Not what I expected]

It makes no difference if evil-mode is enabled before or after we enter org-mode or set org-return-follows-link.

I also tried it with evil-org-mode from https://github.com/Somelauw/evil-org-mode, but that didn't make any difference either. I did notice some code in there that seems to optionally customise the behaviour of the return key according to a "keymap theme", but I didn't seem to be able to make any difference either by playing with that.

So, any idea how I can follow links in org-mode with evil-mode enabled, using RET? I suppose one option is just to override the mapping of RET to be org-ret, but I get the feeling that that will interfere with other uses of the key that evil relies on. Is there a smarter way that these two behaviours should be integrated?

Thanks.


texts: How to prevent whitespace cleanup at point?

texts:
I have hooked whitespace-cleanup to before-save-hook and there is a timer to  auto save buffer every  5 seconds.

When i am  typing something, or coding in python, I stop once in a while and buffer will be whitespace cleaned.

So this text

Emacs  is |

becomes

Emacs is|

and

def foo():
     x = 1
     |

becomes

def foo():
     x = 1
|

It is quite annoying to type all  that whitespaces again and again.  How can i prevent whitespace cleanup at point but still clean  whitespace in the remaining buffer?


texts: Why does `make-symbol` work in macro expansion, just as `gensym` works?

texts:
In the dash library I noticed the use of make-symbol to avoid symbol conflicts during macro expansion.

(defmacro --filter (form list)
  "Anaphoric form of `-filter'.
See also: `--remove'."
  (declare (debug (form form)))
  (let ((r (make-symbol "result")))
    `(let (,r)
       (--each ,list (when ,form (!cons it ,r)))
       (nreverse ,r))))

From what I read in common lisp books, gensym is used for things like this to create a unique symbols via.

(let ((r (cl-gensym "result"))) ...)

I'm confused because when I macro expand this kind of form.

(let ((result '(1 2 3 4)))
  (--filter (> 2 it) result))

I get this and it looks like the symbol created with make-symbol named result is indeed conflicting with the result that contains '(1 2 3 4).

In fact, when I copy the result of this macroexpansion and run it myself I get what I expect: nil.

(let ((result '(1 2 3 4)))
  (let
      (result)
    (--each result
      (when
          (> 2 it)
        (!cons it result)))
    (nreverse result)))

But this seems to work. Instead of returning nil as I would expect from the macroexpansion. Why is this?

(let ((result '(1 2 3 4)))
  (--filter (> 2 it) result))
;; => (1)


texts: Very short key bindings for emacs commands

texts:
There are some text actions that I use so often in emacs that the user-made commands I currently use, invoked with the standard  M-x ... RET procedure do not satisfy me.
I would like to replace their key bindings with shorter ones, with as few keystrokes as possible (ideally two, as it is in elaborate IDEs).
It seems I cannot use keyboard macros here because according to the manual, Keyboard macros are not "powerful enough" to achieve what ordinary Emacs commands do (according to https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html).

Perhaps I can override some builtin C- or M- commands ? There are several that I will probably never need anyway. Is there a safe, recommended way to do this ?

An example : wrap the currently selected text into phpbb italics tags. All the solutions I could find, here or there, use M-x. I tried to make a non-interactive version as follows :

(defun wrap-with-italics-phpbb-tag (start end)
  "Wraps the selected text or the point with a tag"
  (let (string)
    (if mark-active
        (list (setq string (buffer-substring start end))
          (delete-region start end)))
    (yas/expand-snippet (point)
                        (point)
                        (concat "[i]" string "[/i]"))))

(global-set-key (kbd "C-i") 'wrap-with-italics-phpbb-tag)

This does not work because  global-set-keys expects an interactive command.


texts:
I've used the toggle-transparency function from https://www.emacswiki.org/emacs/TransparentEmacs

 (eval-when-compile (require 'cl))
 (defun toggle-transparency ()
   (interactive)
   (if (/=
        (cadr (frame-parameter nil 'alpha))
        100)
       (set-frame-parameter nil 'alpha '(100 100))
     (set-frame-parameter nil 'alpha '(85 50))))
 (global-set-key (kbd "C-c t") 'toggle-transparency)

but although this makes the transparency less, it does not completely remove transparency for me (for some reason). I'm on Ubuntu 14.04.


texts: Is there a way to disable the "buffer is read-only" warning?

texts: I don't find this warning particularly helpful and pretty distracting because it hides the current text in the echo area for a brief moment. Is also seems unnecessary, because I will notice anyway that I cannot write in read-only areas. Is there a way to disable it?


texts: use a single abbrev-table for multiple modes?

texts:
I would like for all my text-based modes (org, markdown, message, mu4e-compose, etc) to use a single abbrev-table, and especially, to add new abbrevs to that shared table whenever I'm in one of those modes.

I know that inheritance between modes is possible, and I think something like this should allow one mode to inherit from another:

(defun endless/ispell-word-then-abbrev (p)
  "Call `ispell-word'. Then create an abbrev for the correction made.
   With prefix P, create local abbrev. Otherwise it will be global."
  (interactive "P")
  (let ((bef (downcase (or (thing-at-point 'word) ""))) aft)
    (call-interactively 'ispell-word)
    (setq aft (downcase (or (thing-at-point 'word) "")))
    (unless (string= aft bef)
      (message "\"%s\" now expands to \"%s\" %sally"
               bef aft (if p "glob" "loc" ))
      (define-abbrev
        (if p global-abbrev-table local-abbrev-table)
         bef aft)))
  (write-abbrev-file))

So I would really prefer to set local-abbrev-table to the same table in all those text modes.  Is there a good way to do this?


texts: When using emacsclient, how can I open the file in the active buffer?

texts: When I open a file with emacsclient without invoking -c, Emacs visits the file in a new buffer in the background while leaving my current window configuration in place.  I'd like to change this, e.g. to open the file in whichever buffer is currently active.


texts: tell org to treat block quotes as a special environment?

texts:
In org-mode I use block quotes.

#+BEGIN_QUOTE
Foo.
#+END_QUOTE

However, when I do org-edit-special inside a block quote, I get No special environment to edit here. How can I direct org-mode to treat block quotes (and verse quotes etc) as special environments, so that when I do C-c ' I can edit the quotation in its own buffer the same way I can with other code blocks?


texts: Tramp and Dired: Initial default-directory/dired-directory

texts:
I'm trying to use tabbar to setup groups for each remote host where I have buffers open. I need to get the full buffer name, so I can parse the hostname to set the group name.

I've figured out how to do everything I want, except for when using tramp and dired.

When I initially open /ssh:dev:/home/fandingo/, I get some strange values for dired-directory and default-directory:

 (default-directory .
   #("/ssh:fandingo@dev:/home/fandingo/" 5 12
     (tramp-default t)))

 (dired-directory .
                  #("/ssh:fandingo@dev:/home/fandingo/" 5 12
                    (tramp-default t)))

(I used M-x pp-eval-expression RET (buffer-local-variables) RET to get this info.)

If I navigate to a directory within this buffer (say elisp/), these variables become "normal:"

 (default-directory . "/ssh:fandingo@dev:/home/fandingo/elisp/")

 (dired-directory . "/ssh:fandingo@dev:/home/fandingo/elisp/")

If I go up (..) to the original directory, things go back to the weird values.

What variable or function can I use to consistently get the full tramp path, regardless of whether I've navigated anywhere or not in the dired buffer?

Alternatively, how can I transparently handle both data structures to get the tramp path? I'm not sure I even understand what Emacs is returning in the originally visited directory (It's not a list, or at least I couldn't car it.).

GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.16.6)


texts: Temporarily preventing helm from reading the mini-buffer

texts: I use helm to select research papers for citation. I am currently trying to implement a command that would sort papers based on multiple criteria selected by the user. The input for this command (i.e. the sorting criteria) is obtained by using  completing-read-multiple. To enable completing-read-multiple to use the mini-buffer (which had been used by helm for inputting the filter), I set enable-recursive-minibuffers to t. The problem is that helm interprets the input to completing-read-multiple as part of the filter. How do I avoid this? That is, how do I temporarily prevent helm from reading the mini-buffer.


texts:
I've installed the solarized theme package via MELPA. I can select one of the two solarized themes via `customize-theme and it activates it. When I save the theme settings it adds the following to my init.el file:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes (quote (solarized-dark)))
 '(custom-safe-themes
   (quote
    ("8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

When I launch Emacs it doesn't load the theme but I don't get an error message either. In fact running eval-buffer in the init.el file loads the theme.


texts: use-package do not bind in latex-mode-map

texts:
this is a part of my init file

(use-package tex-site
 :ensure auctex
 :mode
   ("\\.tex\\'" . latex-mode)
 :bind
   (:map LaTeX-mode-map
     ("<f5> <f5>" . TeX-command-save-buffer-and-run-all)))
 :init
  (defun TeX-command-save-buffer-and-run-all ()
  "Save the buffer and run TeX-command-run-all"
  (interactive)
  (let (TeX-save-query) (TeX-save-document (TeX-master-file)))
  (TeX-command-run-all nil))

None binding is done in latex-mode, but if I evaluate this after a tex file has been opened,it  works fine.

I tried (find-file "mwe.tex) in my init file, and the bindings works.
I suppose there is a smarter way to make this init file work like I want it to


texts:
Is there something like apply-partially

(apply-partially FUN &rest ARGS)

Return a function that is a partial application of FUN to ARGS.
ARGS is a list of the first N arguments to pass to FUN.
The result is a new function which does the same as FUN, except that
the first N arguments are fixed at the values with with which this
function was called.

But with the "last N arguments are fixed"

Or "all arguments are fixed except wildcard" ie:

(defun foo (a b c))
(defalias 'fix-a-c-in-foo 'apply-partially-wildcard 'foo "a valuel" '_ "c value")

_ - random symbol that means "wildcard"


texts: Why does the font height change when bold?

texts:
It's so annoying...

When any text on a line has its face changed so that the text is bold, the height of the line increases by (I assume) a single pixel.  It's best shown with an image:

Why is this?  How do I prevent it?

As requested, info on the platform:

Debian GNU/Linux sid (unstable) on amd64
Emacs uses libgtk-3.so.0 (gtk 3.14.5), on XFCE 4.12

I've tried the following fonts at 8pt, 9pt, 10pt and 11pt:

DejaVu Sans Mono
DejaVu Sans
DejaVu Serif
Droid Sans Mono
Liberation Mono

The problem occurs only with DejaVu Sans Mono and DejaVu Sans, and only at 9pt and 10pt.  (Image above shows DejaVu Sans Mono-9.)


texts: backward-kill-word kills too much, how to make it more intelligent?

texts:
I'm looking for a way to reduce what Emacs kills when I use backward-kill-word.

protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
{
    if (PropertyChanged != null)
        PropertyChanged(this, e);
}

If I'm editing the above code in Emacs and I place my cursor on the very last character (the }) and I call backward-kill-word, the entirety of e); is killed, since Emacs only considers the e to be a word.

Another example is if you place your cursor on the 'P' of PropertyChanged(this, e) and call backward-kill-word, the entirety of null) before it is killed. The closed parenthesis is simply considered to not be a word.

My question is how I can eliminate this behavior. I want characters like ), ', }, etc. to be treated as words by backward-kill-word. This means that backward-kill-word kills these characters and the cursor replaces them, just how backward-kill-word typically behaves for one-character-long words like e. One possible solution I've thought of is to somehow edit what Emacs considers to be words and simply add the characters I want to the list. Regardless, thanks for the help!


texts: Conflict with TAB keybinding for Yasnippet and Orgmode heading

texts:
I tried to use Yasnippet to create a template for org-drill "flashcard"
# -*- mode: snippet -*-
# name: Orgdrill twosided card
# key: drill2
# --
* ${1:Write title here}                                                                                :drill:
:PROPERTIES:
:DRILL_CARD_TYPE: twosided
:END:

${2:Write instructions here}

** ${3:Side Title : ex "German side"}
${4:Content of the card}

** ${5:Side Title : ex "French side"}
${6:Content of the card}

** Example/Hint (if any)
$0

Nevertheless, when added to the buffer I cannot go from field to field with the TAB key because it messes up with the behavior of the orgmode headings.
I tried to remap like this :
(define-key yas-minor-mode-map (kbd "<C-prior>") 'yas-prev-field)
(define-key yas-minor-mode-map (kbd "<C-next>") 'yas-next-field)

But I had no success


texts: No execution of code blocks upon export from org-mode to pdf

texts:
What could possibly preventing execution of code blocks upon export to pdf, if org-export-babel-evaluate is t? :results is set to silent on the relevant codeblock but I don't think that should affect execution upon export.

If I set :exports to results the file outputted by the code block is inserted at the end of the document.

If I set :exports to both the file is inserted correctly (ie where the link is), but then the codeblock is of course also inserted. Neither is useful as I would just like the file generated by the codeblock to be inserted at the location of the link.

Example:

** CODE
#+begin_src clojure :var bc=case :colnames no :results silent :tangle ../src/roight/core.clj
  (ns roight.core
    (:require [roight.org]
              [roight.sim]
              [incanter.core]
              [incanter.charts]
              [incanter.pdf]))

  (defn calc-bc [bc]
    (apply  #(- (* (+ %1 %2 %3) %5) (* %4 %5)) bc))

  (defn sample-business-case [case i]
    (map calc-bc (repeatedly i #(map roight.sim/sample case))))

  (let [business-case (roight.org/org-table->map bc)
        chart (incanter.charts/histogram (sample-business-case business-case 20000))]
    (incanter.core/view chart)
    (incanter.core/save chart "org/business-case.png"))
#+end_src
** Illustration
   #+CAPTION: Simulation of the business case
   #+NAME: fig:business_case_simulation
   [[./business-case.png]]

I am using Emacs 25.1.50.1 and org-mode 8.3.2 on OSX.

Remark by Tobias:
The effect described by mac cannot be reproduced with the html-file export of the following example using an emacs-lisp code block, emacs 24.3.1 and org-mode 8.3.2. The figure is shown between the first and the second sentence -- as it is expected. This rises the question whether the problem is clojure-specific.

#+begin_src emacs-lisp :exports results :results silent
(with-current-buffer (find-file-noselect "testsvg.svg")
  (delete-region (point-min) (point-max))
  (insert "<svg version=\"1.1\" baseProfile=\"full\" width=\"300\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\">
  <rect width=\"100%\" height=\"100%\" fill=\"red\"/>
  <text x=\"150\" y=\"125\" font-size=\"60\" text-anchor=\"middle\">Test</text>
</svg>")
  (save-buffer))
#+end_src
** Illustration
   The figure is placed below this first sentence.

   #+CAPTION: Simulation of the business case
   #+NAME: fig:business_case_simulation
   [[./testsvg.svg]]

   The figure is placed above this second sentence.


texts: How to use xref-find-references on Elisp files without "No references found for" errors

texts:
I am using GNU Emacs 26.3 on Ubuntu 19.10.

I have a directory full of Emacs Lisp files with the .el file extension. All of them are loaded into the currently running Emacs.  I can open up one of those files, put point on a function that is being called, and then use M-. to go to that definition. That works. But when I use M-? (which is bound to xref-find-references) I get an error of the form:

user-error: No references found for: xxx

where xxx was the symbol at point.

I thought this was due to not using a TAGS file, so I generated one using:

cd ~/my_emacs_lisp_dir1
etags -l lisp ../my_emacs_lisp_dir1/*.el ../my_emacs_lisp_dir2/*.el

And that did work as it produced a TAGS file where I expected it to be which is in ~/my_emacs_lisp_dir1/TAGS.

In Emacs, I visited that TAGS file using visit-tags-table. And then tried M-? on the symbol again, and it still failed with the above error.

I then executed xref-etags-mode from within that same .el buffer and tried again. Still I got the same error.

Opening up the TAGS file and searching for the symbol only turns up what I believe to be an indication of which file a symbol is defined in, but I don't see how it could record references to where that symbol is referenced from. So that may be the problem, and if so, how do I make it tell me which functions and files refer to the symbol at point?

Update 1: It works for standalone files, but not in my Git-controlled HOME directory

I noticed that it does work if I do something silly like this:

rm -rf /tmp/xref-test-dir
mkdir -p /tmp/xref-test-dir
cd /tmp/xref-test-dir

cat > func-1.el <<'EOF'
(defun xxx-func-1 ()
  (xxx-func-2))
EOF

cat > func-2.el <<'EOF'
(defun xxx-func-2 ()
  (message "xxx-func-2 called"))
EOF

etags -l lisp *.el

Then go to each of the two .el files, and run eval-buffer on them and then point point on the call to xxx-func-2 and it at least did something that I think is correct: It showed a buffer with this info:

/tmp/xref-test-dir/func-1.el
2:   (xxx-func-2))
/tmp/xref-test-dir/func-2.el
1: (defun xxx-func-2 ()
2:   (message "xxx-func-2 called"))

I noticed that somewhere along the way I was prompted for a project directory and I supplied it /tmp/xref-test-dir.

But I got no such prompting from when I did it inside my ~/my_emacs_lisp_dir1 directory.

I dug even deeper into the xref-backend-references function, and found some code dealing with projects. So I went back to the .el file inside ~/my_emacs_lisp_dir1 directory, and ran this via eval-expression:

(project--find-in-directory ".")

and it returned this:

(vc . "~/")

that sort of makes sense because both ~/my_emacs_lisp_dir1 and ~/my_emacs_lisp_dir2 are within a Git repo.

But I'm still stuck because I don't know how to tell "it" to just look into those two directories, or even look into the files in that same directory.


texts:
When I use git checkout to change to a different state of a project with files open in emacs with different state, the files are not changed automatically. Instead on any modify attempt, emacs is asking to modify or revert etc the file. Typing r is opening current state of the file.

Is there a module to give auto change the open current buffer upon file change on isk with git checkout s?


texts: Restrict the ECB file tree to files known by projectile OR files not in my .gitignore?

texts:
As I am working more and more with these modern "compiles to Javascript" languages my ECB files view becomes more and more cluttered. Projectile seems to get things right out of the box by ignoring everything that is part of my .gitignore file, can I tell ECB to do something similar? Specifically I want to get rid of those .js and .js.map files.

I am aware of M-x customize-group RET ecb-sources and source-file-regexps but that seems like a global solution to a local problem: In other projects I need to see files with these extensions.


texts: Why are my .dir-locals not being applied even though they are loaded

texts:
Still on a never ending quest to get per project settings working for python using tramp and .dir-locals.

Hitting a strange problem when I open a buffer I am asked if i would like to run my .dir-locals.el to which I reply yes, everything applies and I do not see any errors.

How ever they are not applied, if how ever I create an org file and setq all the parameters everything works.

Currently using this minimal example generated by emacs.

((python-mode
  (python-shell-interpreter . "/docker:root@hackdev_django_1:/usr/local/bin/python")))

Also had this format originally both of which should be valid ?

((nil .
      ((python-shell-interpreter . "/docker:hackdev_django_1:/usr/local/bin/python"))))

My only thought is that its because its a remote tramp setting I am applying although the files are stored locally.

I can tell the parameters are not set because any python interpreter command errors with a local path as opposed to the org applied version which just works.

Any suggestions on what to check or possible source of my issue ?


texts:
I wonder if there is any package which lets me do this:

Hightlight entire line where point is currently located
If you move point away, it keeps the that line highlighted
Multiple lines can be highlighted in similar way
Clear all highlights with another command

I think this is very useful and I wonder someone would have done it already.

-- A newby EMACS lover.

Edit: Adding more explanation
Let's say I have a file with 10 lines, I want to highlight 3rd, 5th and 7th line. What I would like to do is, move point to those lines one by one and execute some command (let's say highlight-this-line), it should keep the past highlighted lines as highlighted until let's say clear-highlight-command is executed which should clear all highlights


texts: Simulate shift key press depending on preceding text

texts:
When writing text, I would like not to have to press "Shift" when, say, the preceding text is a sentence end (e.g., ".  ").

So, for example, if I have written Hi. and then I type b, a B should appear on the buffer.

I imagine this could be done by advising self-insert-command or expand-abbrev.

It is important that the solution works well with abbreviations.  So, if b is expanded into "bye", then typing b in the previous example should expand into Bye.

I don't want to use the auto-capitalize package, as it is noticeably slow and sometimes incompatible with other packages.


texts: Org babel: Use variable to set a figure caption

texts:
This is what I want to do:

In some-file.org:

* Table 1
#+NAME: table-1-title
Characteristcs of Data

#+BEGIN_SRC R :file table-1.svg :results output graphics file
  (
    ggplot(mtcars, aes(mpg, cyl))
    + geom_point()
  )
#+END_SRC

#+caption: > HERE I WANT TO USE THE table-1-title VAR DEFINED ABOVE <
#+attr_latex: :width 375px :placement [H]
#+RESULTS:

I want to use the table-1-title variable to set the caption. Any ideas?


texts:
Occasionally I get error from mu4e error in process sentinel: Database is locked by another process. To solve this issue I usually end up to kill the process in list-process or sometimes pkill emacs in bash. That had been very frustrating so I thought about killing *mu4e-prcess* every time some mu4e command ends up executing. In a lisp I do implement it with advice

(defun my-mu4e-kill (frm &rest args)
  (mu4e~proc-kill)
)

(advice-add 'mu4e~proc-send-command :after #'my-mu4e-kill)

Briefly testing I was able to open multiple mu4e instances and look into maildirs and mail. But I came across two issues.

First one is that mu4e does not wait for update process to finish before it exits. Second one is that I no longer are able to open mu4e starting it with command emacsclient -c -e "(mu4e)" from which I get an error:

*ERROR*: Lisp nesting exceeds ‘max-lisp-eval-depth’

while emacs --eval "(mu4e)" works fine!

Why I am getting these errors and is it possible to resolve them in my .emacs?


texts: Insert into specific buffer (not the active buffer)?

texts:
Is there any way to insert text into a buffer that isn't the active buffer with Elisp?

Perhaps there is an equivalent to with-temp-buffer that takes a specific, existing buffer as an argument?


texts: Org-mode does not load Latex previews at startup

texts:
In org-mode, Latex previews are not loaded at startup when using #+STARTUP: latexpreview. I've also tried customizing org-startup-with-latex-preview with no effect. Only way to preview latex fragment is individually doing so by using C-c C-x C-l

As example I'm using the following org file:

#+STARTUP: showall indent latexpreview entitiespretty
* dfs
* df [2/2]                                                              :prb:
- [X] sdf
- [X] sac
* LaTeX embed:
** \gamma \alpha \beta \theta Caracteres especiales, renderizados con: C-c C-x \ Se hace permanente con #+STARTUP: entitiespretty
** Subscripts M_sun ( =M_sun= ) | Superscripts 2^2 ( =2^2= C-x 8 RET hex RET)
** $a ^2=b$ Previsualizar con =C-c C-x C-l=
** Previsualizar con =C-c C-x C-l=
\begin{equation}
x=\sqrt{b}
\end{equation}

Edit:
Following tobias advice I checked with emacs -Q which seem to work, but now, I don't know what is it in my emacs init file that is making the previews to fail. Next is my init.el file:

(add-to-list 'load-path' "/home/khamsin/.emacs.d/cc-mode")
(add-to-list 'load-path' "/home/khamsin/.emacs.d/custom")

(setq ring-bell-function 'ignore)
(tool-bar-mode -1)
(menu-bar-mode -1)
(setq inhibit-startup-message t)

(require 'package)
(package-initialize)

;; Activate Solarized theme
(load-theme 'zenburn t)

;; Elpa repositories:
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) ; Org-mode's repository

;; Acivate Line Numbers
(global-linum-mode 1)

;; Ativate indentation at RET
(global-set-key (kbd "RET") 'newline-and-indent)
;; (define-key c-mode-base-map (kbd "RET") 'newline-and-indent)

;;;;;;;;;; Org require and configuration ;;;;;;;;;;
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)

;; Shift select config
(setq org-support-shift-select t)

;; Org mode margin
(setq-default fill-column 80)
(add-hook 'org-mode-hook 'turn-on-auto-fill)

;; Autopair
(defun autopair-insert-opening ()
     (interactive)
     (when (autopair-pair-p)
       (setq autopair-action (list 'opening (autopair-find-pair) (point))))
     (autopair-fallback))

;; C Style identation
(setq c-default-style "bsd"
          c-basic-offset 4)
(setq-default c-basic-offset 4
                  tab-width 4
                  indent-tabs-mode t)
(add-hook 'c-mode-common-hook '(lambda () (c-toggle-auto-state 1)))

;; Set default font
(set-default-font "Ubuntu Mono-14")

(set-fontset-font "fontset-default"
                  'japanese-jisx0208
                  '("Source Han Sans JP" . "iso10646-1"))

;; Org LaTeX alignment
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(initial-frame-alist (quote ((fullscreen . maximized)))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )


texts:
I am a fairly new Emacs user and just switched to using Spacemacs instead of trying to do all of the Vim configuration myself. It included a whole bunch of packages that I had not been using before, including Helm. I am willing to bet that I am missing something completely obvious, but I can't figure out how to search up a directory for file names without leaving the Helm search results.

What I am doing:

I type :e <TAB> and get a list of filenames.
I see I am in the wrong directory and type ../ to go up a directory
Helm shows me anything in the current directory with any two characters followed by /

What I want to happen:

I type :e <TAB> followed by ../ or some other simple sequence
Helm shows me the contents of the directory above my current location

Similar behavior

I see that I can type :e ../<TAB> to get the contents of the directory above me or that I can hit <ESC> followed by ../<TAB> but these both hide the search result window which I find a minor annoyance.

I feel that this is simple enough that I must be missing something. Is there a way to get this behavior?


texts: Can timestamps exported to html be customized?

texts:
I want the timestamp <2017-07-26 Wed> in my org document to be exported to html as Wed 26-July '17. Is this customization possible?

More generally, is it possible to customize how timestamps are exported to various formats, such as latex, ascii, etc?

Issuing M-x org-version yields Org mode version 9.0.9 on my system.


texts: Report wrong Elpy-Behaviour, but to whom and how?

texts:
I'm using emacs to write my python-code and lately I found some wrong behaviour of one of the auto-format-features:
Given this wrong code:
def doStuff(self, s_database):
    return ("ASDF"

@staticmethod
def doOtherStuff(self, param):
    doSomething()

Will be formatted to this and add an extra-error:
def doStuff(self, s_database):
    return ("ASDF"

@ staticmethod
def doOtherStuff(self, param):
    doSomething()

I assume this is not intended and would like to report it to the developers, but who would that be in my case?
Here's my Elpy-Config:
Emacs.............: 26.3
Elpy..............: 1.35.0
Virtualenv........: None
Interactive Python: ipython3 7.13.0 (/usr/bin/ipython3)
RPC virtualenv....: rpc-venv (/home/qohelet/.emacs.d/elpy/rpc-venv)
 Python...........: python3 3.8.5 (/home/qohelet/.emacs.d/elpy/rpc-venv/bin/python3)
 Jedi.............: 0.18.0
 Rope.............: 0.18.0
 Autopep8.........: 1.5.5 (1.5.6 available)
 Yapf.............: 0.30.0 (0.31.0 available)
 Black............: 20.8b1
Syntax checker....: flake8 (/home/qohelet/.local/bin/flake8)

I presume it's Autopep8 or flake8 (or even pycodestyle?), but would I write to them or is there a certain developer for the emacs-package?


texts:
What I actually want

I have deep folder structures, and often use a dozen folders pretty far down the directory tree. In Nautilus, I use bookmarks to get to them quickly. I want the same thing in Emacs, as I plan to use Dired more.

My plan

My plan is to have a folder of symlinks to all my bookmarks somewhere on my file system, and a function in Emacs which launches dired with that folder and then invokes ace-jump-mode.

My question

What does that function look like?

Of course, if there is a better way to achieve this, I'd be happy to learn about it. I read about dired bookmarks and they don't seem to do what I want (if I understand what they do, which is not necessarily the case) as I can't have changes in my ~/.emacs.d folder during normal use and those bookmarks would change every time I mark something.


texts: Use all the codes in the existed equations as the backend for autocompletion when type new equation

texts:
I find that I often have to suffer typing some similar latex codes many times in different equations or the same equation. So it will be convenient that all the codes in the existed equations in the buffer could be used as the backend for autocompletion.

It seems to me that it should be the same technique  used in the autocompletion for the plain text. That is,

collect all the codes/words separated by space  in the buffer as the backend
list the candidates with the same beginning

It's great if some superuser can implement this. Any comments or suggestions are also welcome.

PS: I already use cdlatex for symbol completion. As I tested, company-auctex didn't list the codes in the existed equations.


texts: Removing preceding text from each line of a text

texts:
I am new to Emacs. I am reading a book on Python. The book has many code examples. What I would like to do is to

convert this:

 61. def getRandomWord(wordList):
 62.     # This function returns a random string from the passed list of strings.
 63.     wordIndex = random.randint(0, len(wordList) - 1)
 64.     return wordList[wordIndex]

in to this:

def getRandomWord(wordList):
    # This function returns a random string from the passed list of strings.
    wordIndex = random.randint(0, len(wordList) - 1)
    return wordList[wordIndex]

removing one space + the number + one space that appears at the beginning of each line. I'm sure there are multiple ways to accomplish this. For example, a regex search, multiple cursors, or a command that removes the first 5 chars from each line of a text.

Question:

If you were going through a text with a lot of code examples that you wanted to copy/paste into Emacs, what method would you use to remove the line numbers?


texts:
dired-do-copy copies a symlink as a symlink.
Sometimes I want to copy the actual file of a symlink,
not make a copy of the symlink.
Is there already a way to do that?
I can write some elisp code but seems this must be already builtin to dired.


texts: Obtaining a backtrace on batch invocation of Emacs?

texts:
The only way I know of printing a backtrace for errors in batch invocation of Emacs is by setting debug-on-error inline like so:

$ emacs -batch --eval "(setq debug-on-error t)" -f "my/foo-function"

Is there a more idiomatic method for displaying backtraces for errors in batch mode?


texts: Using a function as an org-babel header argument

texts:
Say I am using org-babel to tangle code blocks from an org document. I have several blocks with random code in them.

My goal is to dynamically tangle (or not) individual blocks following a condition, for example, contents of first line of block, text in above heading, tag in heading, etc.

More generally, I want to pass the same defun as an argument to :tangle in the header arguments of all code blocks, avoiding the use of heading or buffer properties. Similarly, I try to avoid setting the same identical form in all my code blocks. Instead, I try to define a default header argument to be set programatically, or similar in the example

*  First                  :maybe:

#+begin_src emacs-lisp
  ;; First : not to be tangled

#+end_src

* Second                  :no:

#+begin_src emacs-lisp
  ;; Second : not to be tangled

  ;; This code doesn't do it but it should !!
  (setq-local org-babel-default-header-args
          (cons `(:tangle . ,(test))
              (assq-delete-all :tangle org-babel-default-header-args)))
#+end_src

* Third                   :yes:

#+begin_src emacs-lisp
  ;; Third : this code is to be tangled

  (defun test ()
    (if (let ((mytags (org-get-tags-at (point) t)))
          (or (member "yes" mytags)
              (null mytags)))
        (format "%s.el" (file-name-base
                         (buffer-file-name))) "no"))
#+end_src

So my question is, is it possible to assign a function to the :tangle (or :prologue) header arguments in org-babel code blocks without using properties or explicitly put the form in all code blocks ?


texts: How to specify org-capture template for a weekly journaling

texts:
This is what I used to have before:

("w" "Weekly" item (file+weektree (concat org-directory "Weekly.org")))

(where org-directory is ~/Notes) and it used to create a tree of this formatin ~/Notes/Weekly.org:

* <YEAR>
** <YEAR>-W<WEEK#>

This started failing once I updated org because the four ways of specifying a date tree were merged into one so I tried

("w" "Weekly" item
  (file+olp+datetree (concat org-directory "Weekly.org") :tree-type 'week))

However, now it complains Invalid file location: nil. I checked the value of org-directory and it's the same. Replacing the concat with the full path of the file works. I'm not sure why it doesn't accept the concat call.
The other issue is that it throws an error for how the :tree-type is specified. I tried specifying it as week, 'week and "week" but it doesn't accept any of them. What's the right way to specify it?


texts:
I am using some complicated combination of Cygwin (for emacs) and Docker (for Linux environment) for C++ development on my laptop.

Recently I noticed that Docker dumps lots of ANSI and XTERM sequences into my *Compilation* buffer. Using redirection solved the problem:

docker run .... 2>&1 | cat

This tells me that somewhere between the latest Cygwin, Emacs and Docker the Docker now thinks it's running in a proper interactive terminal. I'd rather the Docker behaved as if it's redirecting to a file and not do things like clear screen and colorize the output.

So the question is: Is there any way to run the compilation command in Emacs without allocating a TTY?

P.S. I considered the ANSI filter on compilation output as described here. It does not quite work, as the Docker uses cursor positioning and other XTerm escape sequences that ANSI library in Emacs does not understand, plus it inserts newlines to clear screen and limit lines to 80 characters.


texts:
Currently when performing evil-search-forward , pressing C-w causes the cursor to yank and append the current word to the search (because that's what isearch does).

I'd like to change that to the usual delete-word, but remapping it in isearch-mode-map causes the under the cursor to get deleted.

Any way I can fix this?


texts: I can visit URLs in a message with g, bound to mu4e-view-go-to-url, which uses the default browser. How can I copy it to the clipboard to view it on another browser?


texts:
I don't understand how pull request are working.
I want to merge a rcp in el-get so I made a pull request
https://github.com/dimitri/el-get/pull/2825
but, until now, the code I unchanged.
Is there anything else I have to do for that or just wait ?
https://github.com/dimitri/el-get/blob/master/recipes/oef-mode.rcp


texts: Better way to find regexp in emacs buffer

texts: I'm trying to make a function to read a whole buffer and find lines that match with regexp, I think to read the whole buffer and save to list of strings but I read that it's very inefficient. Whats the better form of do this?


texts: Only run a function if it is a new session

texts:
In my init.el file, I have a hook to setup my workspace when I open a particular type file. Specifically, when I open an R file (i.e., *.R) and ESS-mode starts, a couple of other windows open with vterm and R in them. My Elisp code looks like this:
;; R setup
(require 'ess-site)
(add-hook 'ess-mode-hook
          (lambda()
            (set-window-buffer (selected-window)
                               (file-name-nondirectory (car (last command-line-args))))
            (split-window-horizontally)
            (other-window 1)
            (vterm)
            (split-window-vertically)
            (R)
            (other-window 1)
            ))

When I open a file, say emacs myfile.R, this works as expected. I run into a problem, however, if I open a file once Emacs is already up and running. For example, I run emacs myfile.R and then do C-x C-f myfile2.R then this causes more windows to open.
Q: Is there a way to only run this startup function when there isn't an existing emacs session?


texts: Using an org-table formula to sum up weekly time cards


texts:
I maintain a backend for a custom file export format for org-mode and I would like to add support for custom ATTR_LEANPUB comments (much as LaTeX supports ATTR_LATEX) for tweaking visual display of images and tables and so on.

But how do I capture this information in the backend implementation? org-export-define-derived-backend and org-export-define-backend have no documentation about supporting attributes that I can see.


texts: emacs tramp: how to input a password and additional verification?

texts:
When I manually login into remote server, it first needs to input password, and then input some youbikey like the following prompt.

Password:    (after I input password correctly, then it will show the next line.)
Tap your Key:

Then in tramp, after I input password correctly, it hangs there without any further info. How to make it work in tramp?

I am already using version 25.

So the following doesn't work for me.
Tramp login with 2-factor authentication


texts:
I wrote a terminal output to a plain text file and opened it in Emacs, and I see "^[" here and there. I'd like to change it to tabs in terminal before writing its output to the file, but I don't know how to refer to them. What does "^[" represent?

They have "[1m" or "[4m" right after them.


texts:
Reference to 31.10.6 Diary Appointments

  If you have a diary entry for an appointment, and that diary entry
  begins with a recognizable time of day, Emacs can warn you in advance
  that an appointment is pending. Emacs alerts you to the appointment by
  displaying a message in your chosen format, as specified by the
  variable appt-display-format. If the value of appt-audible is non-nil,
  the warning includes an audible reminder. In addition, if
  appt-display-mode-line is non-nil, Emacs displays the number of
  minutes to the appointment on the mode line.

it mentioned the variables of appt-display-format, appt-audible and appt-display-mode-line,
Unfortunately, I cannot find the variables with prefix of appt

eval (appt-audible) but  report :
 Symbol’s function definition is void: appt-audible

Why I cannot not find the variables of appointments?


texts: Extract phone numbers from multiple org files

texts: I create one folder per person for my patients. For every visit a new org file is created in a folder with date stamp.org as file name. The org file contains name and phone number of the person in addition to other details. I would like to extract name and phone numbers to a single file. Is it possible. Kindly help.


texts: What is this mini pop-up box and how do I get rid of it?

texts:
I don't know what combination of keys I pressed to bring up this mini-box, but it's annoying me.

What is it and how do I get rid of it?

EDIT:

It pops up when I press C-S-u


texts: How to :delight major mode strings when using powerline with use-package?

texts:
I am unable to :delight major mode strings (in the mode-line) from use-package because I am intializing powerline with use-package itself.

My guess is that the :delight'ing part occurs at the wrong time and mode-line-format is set without the updated major mode strings (it works fine if powerline is :disabled).

What is a good approach to solve this issue?

Here is my init-mode-line.el for reference. New link: init-mode-line.el.


texts: Ivy disable completion for a command in minibuffer

texts:
Can I disable ivy completion for a single command while in minibuffer?

For example I am in folder ~/code/study/ . If I open find file and autocomplete with Ivy I will see

Find file: ~/code/study/

./
../
[...]

and I want, in a single jump go to ~/other/code/study. Since I have ivy-mode to autocomplete I cannot move my cursor to the first / and just type other there. This is being a pain for some things. Can I somehow edit the first part of a completion or even disable completion temporarily just for this command?

Thanks a lot!


texts: How can I save eshell alias settings when using prelude?

texts:
Second day using Emacs.

I've forked the Prelude GitHub project and I'm storing my settings in the personal folder as instructed in the documentation.

I would like to be able to use my eshell aliases across machines with a git pull, but by default it looks like eshell settings are saved under the savefile directory which is by default ignored by git.

How can I put my eshell alias settings in my personal directory?


texts:
I'm looking for a good org-mode "sandbox" or demonstration document that contains a comprehensive survey of general-purpose org-mode features as examples in a self-descriptive form.

My intended application is as a general purpose "org scratch buffer" to test code without needing to write sample content.

For example (from testing/examples/normal.org):

#+TITLE: Example file
#+OPTIONS: num:nil ^:nil
#+STARTUP: hideblocks

This is an example file for use by the Org-mode tests.

* top
** code block
   :PROPERTIES:
   :header-args: :tangle yes
   :CUSTOM_ID: code-block-section
   :END:
Here are a couple of code blocks.

#+begin_src emacs-lisp :tangle no
  ;; 94839181-184f-4ff4-a72f-94214df6f5ba
  (message "I am code")
#+end_src
* accumulating properties in drawers
 :PROPERTIES:
 :header-args+: :var bar=2
 :header-args: :var foo=1
 :ID:       75282ba2-f77a-4309-a970-e87c149fe125
 :END:

#+begin_src emacs-lisp :results silent
 (list bar foo)
#+end_src


texts: Launch doom-emacs with options of main and #1

texts:
Upon launching doom-emacs, it displays

What does the options main and #1 mean?

It toggle [2] as default, how could I toggle 1


texts:
If this is not a relevant place to post this, please let me know.

My common workflow is Vim+Tmux. Mostly i do Clojure coding. Just yesterday i've downloaded and tried Spacemacs, out of curiosity.

One of Spacemacs's claims is that by using modal editing in Evil mode, it minimizes RSI risk (albeit on the Spacemacs home page it is said that there is no proven connection between Emacs key bindings and RSI). I realized though, that heavy use of Vim/Tmux also relies on the use of modifier keys, which most often in my case are Control-key combinations (navigating between Vim windows and Tmux prefix - Ctrl-S in my case).

So i thought that here is the best place to ask about RSI caused by heavy use of modifier keys (Emacs seems to be associated with it, namely the 'Emacs pinky' myth). Is it something scientifically proven? Were there any studies?

If there does exist a correlation, then does e.g. remapping CapsLock to Ctrl help?

P. S. I do have CapsLock mapped to Ctrl. Moreover, in Vim i've remapped Esc to Tab, which is similarly convenient. And it more closely resembles original keyboard layout Bill Joy used when creating Vi. Maybe it was also used by Emacs users back then?


texts:
When should I use macro in my program or not to?

This question is inspired by an informative answer by @tarsius.  I believe many have great experiences to share others.  I hope this question become one of Great Subjective Questions and help Emacs programmers.


texts: How to enable linum-mode only during I-search?

texts:
linum-line it not enabled when emacs is started.

I just want to enable linum-mode (see the line numbers) during I-search and disable it when I-search: is ended. Is it possible?


texts: Is there a way to show an agenda with just a time grid?

texts:
I'd like to use the default prefix for "time grids" in org agenda, but set a custom prefix for other tasks.

One approach could be to use a block agenda, with one block being just a time grid, and another block other just having non time-grid items. Is this possible?

The goal is to not have duplicate items in the block with the time grid, and the block with the custom prefix agenda.

Alternatively, if there was a way to just get the default time-grid prefix when using a custom prefix for normal agenda items that would mean I wouldn't even need a block agenda.


texts: spacemacs: keep track locations of smart search

texts:
I have custom visit history ring which is independant of search seach engine used. I would like spacemacs smart search filled my ring as well.

Details:

1. I'm in some buffer under location1.
2. I've pressed "SPC *" or "SPC /" to do smart searching.
   a. during this helm process I can temporary visit intermediate locations
      through TAB key press. Let's say I visited: location2 and location3.
   b. but I pressed enter for location4.
3. I end up in location4.

I want location1 and location4 be added to my history ring.

Do You have an idea, what functions do I need to advice or what hooks to use in order to achieve this?

There is helm-ag-pop-stack, that might be helpful, but on the other hand it handles ag search engine only, while spacemacs smart search mechanism uses other engines as well.

Global mark ring does not leave location1 either.

best regards


texts: How to use sub addressing (plus sign) in mu4e and mu?

texts:
Many email providers, incl. gmail, support sub addressing using a plus sign.
E.g. an email address rosie@emailprovider.com can have an unlimited number of sub addresses like rosie+sammy@emailprovider.com etc.
So far, I have accumulated hundreds of such sub addresses.
How can I tell mu that everything matching rosie+*@emailprovider.com is actually my email address?
How can use my addresses efficiently, esp. in replies?
Having one context per email sub address is not an option, of course.
Thanks for any help!


texts: search-forward-regexp with back reference

texts:
I have the following text

\begin{comment}
TEXT
\end{comment}

\begin{verbatim}
TEXT
\end{verbatim}

and the regular expression "\\begin{\([^}]*\)} to match the \begin statements and capture the comment or verbatim words. Now, I would like to match the \end statements. Given I already had a match for \begin I thought I could reference the previous match and look for \\end{\\1}, however I am getting Invalid back reference.
Am I doing something wrong? Is there a way to reference previous matches in a regular expression?


texts:
when helm is active, I can press C-c ? to open a buffer containing helpful information for the current helm session. Now, coming from vim, I'd like to have some evil-bindings in that window, but I'm not even able to determine the mode that the buffer is in, as everything except from a couple of keystrokes is not bound to anything.

How can I rebind keys in helm's help-buffer?


texts:
Is it possible to set up an agenda file in org-mode, so that the clocking information is saved at a different location?

At work we have a team-global and version-controlled file with a section hierarchy which I would like to use as an agenda file to do my clocking.  But because this file is used by several people and because it might change (someone might add a new section), logging the clocking times into this file is not really an option.

So, can I tell org-mode to save the logged clocking times at a different location?


texts:
I recently switched to zsh (with oh-my-zsh) as my primary shell, but running the shell from emacs results in some strange (for lack of a better word) "residural" characters; however changing to bash removes these characters:

➜  ~  ^[[?2004h bash
 bash^[[?2004l
coffee@Lappy:~$

Is there any way for me to keep using zsh in emacs without it looking like absolute garbage?


texts: SPC key shortcut is not working in spacemacs

texts:
I've spacemacs installed in my ubuntu/opensuse OS

emacs version 26.3.

SPC shortcut is not working for my spacemacs.

I'm getting message Buffer is read-only: #<buffer *spacemacs*>

Below is the screenshot -

How can I make SPC key work for my spacemacs?


texts: In Org-Mode Agenda view dont show "Scheduled: " if time is provided

texts:
I have setup org-mode and org-mode's agenda view almost exactly as I like it.
Almost, because there is something I still find annoying:

Every scheduled item has a "Scheduled: " in front of it. To me, that is unnecessary clutter and destroys the alignment of my items. So what I want to accomplish is, that items, for which a time is provided (not only date) don't have the "Scheduled: " in front. Thus, they would perfectly align with those that don't have a time provided. Se the white square in my screenshot.

Is something like this possible? Alternatively I would like to remove the "Scheduled: " for all items, but keep the "Deadline: ".

My problem is that I am pretty new to emacs and org-mode and not proficient with lisp. So any help is welcome.


texts: How to make a capture task template that stores a new task at point in the file I am in?

texts:
Org capture is a great tool for capturing notes and task when doing other things inside Emacs. The captured item is stored in a specified file for later review, and the point jumps back to the file it was in when you got the idea. Practical. However, I am also using capture to make tasks when working deliberately in my task file. In this case it would be much more handy if the task template saved the new task at point whichever file I am in, and not to a predefined capture file. After the task is produced I would like point to stay in the headerline of this new task. Is this possible?

Here is a capture template I use for producing task items:

(setq org-capture-templates '((
         "t"                                            ; key
         "Todo"                                         ; description
         entry                                          ; type
         (file+headline "C:/.../privat.org" "tasks")    ; target
         "* TODO [#B] %^{Todo} \nSCHEDULED: %t \n\n%?"  ; template
         :prepend t                                     ; properties
)))

It stores the produced task to the file "C:/.../privat.org" under the heading "tasks", and the "prepend" property makes the new task to be placed as the first subheading under "task".

How can I make the new task be stored at point in whatever file I work in?


texts:
I know I can do something like this:

(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5)

But what If I want to change another property, say :foreground, how do I do it? I don't want to repeat the whole thing again, there's gotta be a better way, right?


texts: Use thing-at-point for isearch and minibuffer commands

texts: How can I insert some text (thing) at point from the buffer into the minibuffer at a text prompt or during an incremental search? Is there a convenient way to insert, e.g., the sexp around point?


texts: orgmode - latex new line in tikz node not work

texts:
Below code works fine if copy the tikzpicture to tex file. but in orgmode, looks like the new line not take effect!
#+header: :imagemagick yes :iminoptions -density 300 -opaque white -flatten -geometry 800 :fit yes :noweb yes :headers '("\\usepackage{tikz}") :border 0 :results raw
#+begin_src latex :eval yes :file debug.png
;; https://blog.codecentric.de/en/2018/04/android-zygote-boot-process/
\usetikzlibrary{chains}
\begin{tikzpicture}[start chain]
  \def\desc{
Description1:\\
- line one\\
- line two\\
- line three
,
Description2:\\
- line one\\
- line two\\
- line three
    }
  \foreach \d[count=\i] in \desc {
      \node[on chain] (P\i) {\d};
  }
\end{tikzpicture}
#+end_src

I try to use \\ also but not work either!


texts: How to turn on line numbering on modes that doesn't have by default?

texts: I have spacemacs and when I edit a .py or .c file line numbering is turned on no problem, however when I open a .R file it isn't there (the mode is named ESS[S] to be precise). How can I turn it on here too ?


texts: Is there an Emacs equivalent for vim-bufferline?

texts:
When I was using Vim in the past, I was charmed of the vim-bufferline. Only when there were not any message displayed or any command invoked, it showed the opened buffers in the minibuffer. It looked like this:

5 buffers opened, the file command is being displayed. It also worked well with multiple buffers in multiple windows opened.

By default my minibuffer is empty, when there is no message. I would like to display the current buffers in that minibuffer. When googling around, I found no Emacs equivalence of this.

Any suggestions?


texts:
Where can I handle how the control + left-click menu displays entries?

This is how it looks when it is displayed the way I want, i.e. with no fancy sorting by file type:

And this is how it looks when it tries to sort files for me...

It randomly toggles after a number of files are opened...


texts: Make forward-list search for specific symbol only

texts:
Is there a way to make forward-list and backward-listsearch for specific symbols (such as 「」『』) only?

I have code that make use of these functions to iterate through 「」『』 pairs in plain text. But forward-list would apply to ()《》〈〉 etc. as well, which makes the code very inefficient.

(re-search-forward "「\\|『" nil t) is not the optimal solution because I am dealing with balanced pairs of quotes, and only have to deal with the outer-most paretheses. For instance, forward-list would stop 2 times in the scenario below, while re-search-forward would take 4.

forward-list:

  「『』『』」1「」2

re-search-forward:

  「1『2』『3』」「4」


texts: tabulate lines according to specified template

texts:
I receive a 1000 lines of code like this:
  t.Branch("met_pt", &evnt.met_pt, "met_pt/F");
  t.Branch("met_phi", &evnt.met_phi, "met_phi/F");
  t.Branch("met_signal", & evnt.met_signal, "met_signal/F");

I would like that all 1000 lines be neatly arranged in columns:
  t.Branch("met_pt",     & evnt.met_pt,      "met_pt/F"     );
  t.Branch("met_phi",    & evnt.met_phi,     "met_phi/F"    );
  t.Branch("met_signal",   evnt.met_signal,  "met_signal/F" );

How can I write a function in Emacs that tabulates (pads with spaces) a block of text according to a template that I specify? I am total beginner in Lisp, I don't know where to start.


texts: If I open calendar and hit p p it shows me —by calling (calendar-persian-print-date)— the Persian date in minibuffer. How can I get Persian date without opening calendar? When I call (calendar-persian-print-date) directly, it says Debugger entered--Lisp error: (void-variable displayed-month).


texts: Why is the Magit M Remote pop-up different than what is shown in the Magit manual?

texts:
The Magit manual, 7.1.1 The Remote Popup, describes the following three commands, but they do not appear in my 'M' popup:

M C   (magit-remote-config-popup)
M p   (magit-remote-prune)
M P   (magit-remote-prune-refspecs)

What is the reason for the discrepancy?

List of commands from Magit manual on https://magit.vc/manual/magit/The-Remote-Popup.html#The-Remote-Popup:

M C
M a
M r
M u
M k
M p
M P

Screenshot from https://magit.vc/screenshots/ > M Remote:

At first I thought there was something wrong with my Magit installation.
But the above screenshot comes from official Magit documentation "A visual walk-through".
So now I wonder if the manual is wrong.

I am running Magit 2.12.1 on Spacemacs.


texts:
I use visual-regexp to make query regexp search. Consider this text:

\enquote{\Large{text1}} \enquote{\Large{text2}} \enquote{\Large{text3}} \enquote{\Large{text4}}

I want regexp to match every and single macro group (the 4 groups). I invoke a query regexp by C-c q and entered this regexp:

\(\\Large{\)\(.?+\)\(}\)\(}\)

Problem is that it returned one match instead of 4 matches:

the \(.?+\) was very greedy to match all 4 macro groups.

But, when I get each of the 4 groups in its own line I get the desired effect:

Now I could do replace with: \2\4 to get the desired result:

So what I was missing when all were on the same line?

Plus, can you please recommend any good documentation on using regexp/grep in Emacs?


texts: Can't remove cursor blinking in console mode

texts:
Emacs 24.3.1, OS: Linux Slackware 14.1.

In my ~/.bash_profile file I have the following:

# If on console, change cursor colour according to
# /usr/src/linux/Documentation/VGA-softcursor.txt
# Reset using echo -e '\033[?2c'
if [ $TERM = 'linux' -a $SHELL == '/bin/bash' ] ; then
    echo -e '\033[?17;0;64c'
fi

This makes cursor non-blinking and makes it red. When I start Emacs the cursor becomes a blinking dash.

In Displaying the Cursor chapter I read this:

  On a text terminal, the cursor’s appearance is controlled by the
  terminal, largely out of the control of Emacs. Some terminals offer
  two different cursors: a “visible” static cursor, and a “very visible”
  blinking cursor. By default, Emacs uses the very visible cursor, and
  switches to it when you start or resume Emacs. If the variable
  visible-cursor is nil when Emacs starts or resumes, it uses the normal
  cursor.

So in ~/.emacs I wrote:

(setq visible-cursor nil)

And restarted Emacs. But it didn't help: the cursor is still blinking, and when I close Emacs it destroys my previous non-blinking cursor.

How to fix?


texts: How to create multi-line descriptions for TODOs in org-mode?

texts:
I've got TODOs that I need to have a long description for but org-mode keeps telling me I have a malformed drawer and adds an additional :PROPERTIES: section. Here's an example of the problem.

*** My task title
    DEADLINE: <2018-01-30 Tue>
    :PROPERTIES:                             <-- adds this section
    :END:                                    <--
    :PROPERTIES:
    :DESCRIPTION: Questions to address:
What is the moon made of?
How many questions can you create for this sample?
What does Google do when you're not searching?
    :END:

Are multi-line descriptions simply not supported or am I formatting things improperly?


texts: /bin/ls --color=always fails to produce colorized output in shell-mode

texts:
I have run M-x ansi-color-for-comint-mode-on.

Also, when I use /bin/ls --color=always (or /bin/ls --color=auto) in a regular terminal, I do see colors in the output.

It's only within Emacs' shell-mode that these commands fail to produced colorized output.  (The variable LS_COLORS is set to the empty string in all cases.)

Strangely enough, grep --color=always does produce colorized output, even in shell-mode.  The echoed commands are are also colorized.

(NB: in the illustration above I passed the options -1aF --color=always to /bin/ls, but I get the same "monochrome" output with no flags, or with any combination of flags, and with any argument for the --color option.)

Is there anything else I need to do to get /bin/ls to produce colorized output in shell-mode?

config

;; ~/.emacs

(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(require 'comint)
(set-face-attribute 'comint-highlight-prompt nil
                    :inherit nil)

# ~/.zshrc
LS_COLORS='';
export LS_COLORS

PS1=$'%# '