texts: wrap each line with a function and collect each value outputs from an org src block

texts:
How do I wrap each line with a function and collect all value outputs from an org src block and collect all value outputs from an org src block?
For example,
If I have
#+begin_src python
3492-134.2
3492-134.2+1428
#+end_src

I would like
#+RESULTS:
: 3357.8
: 4785.8

Not
#+RESULTS:
: 4785.8

According to https://orgmode.org/manual/Results-of-Evaluation.html, adding  :results output to the header will collect every output to the standard stream.
But that would require me to add a print statement to each line manually.


texts: how to use org-mode speed commands (speed keys)?

texts:
This keybinding was working on my Spacemacs with evil mode, org-mode, and ivy:

t   org-todo

and is listed in the Spacemacs bindings:
http://spacemacs.org/layers/+emacs/org/README.html#key-bindings

Then it disappeared:

SPC h d b org-todo  (not listed here)
SPC h d f org-todo  (listed but *Help* page shows no binding)

So I reinstalled Spacemacs, but the key binding is still missing.
Here is how I reinstalled Spacemaces:

delete .spacemacs file
restart Emacs
answered Spacemacs questions:
  What is your preferred editing style? vim
  What distribution of spacemacs would you like to start with? spacemacs
  What type of completion framework do you want? ivy
Emacs says: Skipping check for new version (reason: dotfile)
SPC f e d   (dotspacemacs-configuration-layers)
uncomment 'org' in .spacemacs dotspacemacs-configuration-layers and save
SPC f e R   (dotspacemacs/sync-configuration-layers)

Is that the correct way to reinstalled Spacemaces?
I am new to Emacs so maybe I missed something.

This might be related: "<t> is undefined" error on first keypress

I am running Emacs 25.2.1, with Spacemacs, evil mode, org-mode, and ivy on Fedora 25.

UPDATE

I reopened my Emacs and 't' worked again.  So 't' works intermittently.

I did the following in hopes of making 't' work consistently.

Open dotspacemacs-configuration-layers:

SPC f e d

Add this to ~/.spacemacs file, at top of defun dotspacemacs/user-config ():

;; Single key command execution when at beginning of a headline
(setq org-use-speed-commands t) ; ? speed-key opens Speed Keys help

and dotspacemacs/sync-configuration-layers:

SPC f e R

But typing '?' does not open Speed Keys help.  't' works, but it was working intermittently, so the above install may have effected nothing.

Is that the correct way to install speed keys?

Is there a list of other speed keys compatible with evil mode?

MORE QUESTIONS

Where in dotspacemacs-configuration-layers should the (setq org-use-speed-commands t) be pasted to?
I put it in Add this to ~/.spacemacs file, at top of defun dotspacemacs/user-config ().

Does the 't' in (setq org-use-speed-commands t) only bind 't' to org-todo, or does it bind other commands as well?

The single-key bindings in http://spacemacs.org/layers/+emacs/org/README.html#tree all work for Spacemacs evil mode, except that H and L are bound to evil-window-top and evil-window-bottom respectively.

Most of bindings from http://notesyoujustmightwanttosave.blogspot.com/2011/12/org-speed-keys.html would conflict with evil mode, but probably work with holy mode.

Pressing '?' does not list anything.

FINAL_UPDATE

t (org-todo) has been working for over a week now.
Apparently it was fixed by the issue Jon linked to.

As Kaushal Modi, Alexandro de Oliveira, and Jon suggested, I am NOT using speed keys because I am using Evil-mode.


texts: How to make ediff-patch-file strip leading path components?

texts:
I have a multi-file patch and ediff-patch-file doesn't find the files unless I manually remove all of the "a/" and "b/" prefixes from the patch first. In other words, it acts like "patch -p0" when I want "patch -p1". How do I tell ediff to do what I want?

Example:

diff --git a/src/java/main/com/example/player/PlayerApplication.java b/src/java/main/com/example/player/PlayerApplication.java
--- a/src/java/main/com/example/player/PlayerApplication.java
+++ b/src/java/main/com/example/player/PlayerApplication.java
@@ -907,6 +907,7 @@

Version: GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)


texts: csv-mode: do not split line on newline inside quoted field

texts:
I'm using the latest csv-mode in Emacs 25.3.1 in centos 6.10.  The problem is that I have many fields that are long documentation strings and many of them have embedded newlines.  This messed up csv-mode and causes affected rows to be split into multiple lines in the buffer.

How can I make this usable?  Is there a way to replace newlines embedded in strings with some other character (e.g. |) when reading the file and then put them back when writing the file?


texts: Adding pdf page number/amount back when using powerline with docview

texts: So I started using the powerline addon for emacs, and I noticed that among other things, by default it hides the page number of the pdf file (for instance P1/4) in the mode line. Is there any way to configure powerline to put that feature back? I like being able to see how long the pdf document is (not to mention, it doubles as a download counter when viewing pdfs through eww).


texts: Can Emacs Eshell show remote man pages in TRAMP mode?

texts:
When I'm logged in to a remote machine in eshell I can still do man ls. But it appears that this only work for my local man pages. If I try man yum I'll get a message that the yum man page is not found. However, if I log into the machine via a regular terminal and use man yum there the manual is shown. Is there a way to get remote man pages showing up when in TRAMP mode? I'd really like that because I'm running OS X locally but frequently log in to linux servers where the utilities have different options etc.

Update: To clarify, here's an example session:

Welcome to the Emacs shell
~ $ cd /ssh:example.com:/
/ssh:example.com:/ $ man yum
#<buffer *Man yum*>

Alright! That's expected. But, regretfully, no *Man yum* buffer is created an these messages appear in *Messages*:

Invoking man yum in the background
Please wait: formatting the yum man page...
yum man page formatted
error in process sentinel: user-error: Can't find the yum manpage
error in process sentinel: Can't find the yum manpage

Update 2: I found out (from a comment on this answer) that I can invoke the remote man by prefixing with *, so *man yum -- which is an OK work-around. But it just dumps the content in the eshell window, rather than open a new buffer like the man command does. I'd really like that behaviour.


texts:
Consider the following python code:

As you see the content of expr is font locked as string.
How can I emacs make to format it as if expr=''' and ''' were gone:

Other strings should be font locked as strings, but expressions starting with expr=''' or exprABC=''' etc. should be ignored.


texts: How can I add custom shell command in magit?

texts:
In my project, I write scripts to deploy it to server.
Here are the commands:

npm run deploy:internal
npm run deploy:staging
npm run deploy:production

I want to add custom shell commands to magit, so that I can press ddi to run npm run deploy:internal, dds to run npm run deploy:staging, andddpto runnpm run deploy:production`.

How can I implement this ?

Thanks.


texts: Execute function by using evil-set-register

texts:
I use evil and I want to execute a function by using Emacs macro system.
Let's say I have the following macro.
(evil-set-register ?f [?i ?f ?o ?o ?b ?a ?r escape])

I can run the macro by using @f. But this system is not easy to read and maintain.
Question
How to execute an interactive function by using @f shortcut?
Example
Here's function insert-foobar which inserts string foobar:
(defun insert-foobar nil
  "Insert foobar."
  (interactive)
  (call-interactively 'evil-append)
  (insert "foobar")
  (evil-normal-state))

(evil-set-register ?f (call-interactively 'insert-foobar)) ;; This does not work
(evil-set-register ?f (insert-foobar)) ;; This does not work too


texts: Recursively open files matching regexp in marked directories

texts:
Generally speaking, I would like to be able to open all files within a given set of directories (and their subdirectories) where the filename matches a given regexp.

For example

  /home/nispio/project:
  total used in directory 1612 available 1000000000
  drwxrwxr-x 13 nispio group    4096 Sep 19 14:06 .
  drwxrwxr-x  7 nispio group    4096 Sep 22 16:41 ..
  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 cfg
  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 hlp
* drwxrwxr-x  2 nispio group    4096 Sep 23 16:52 hst
* drwxrwxr-x  2 nispio group    4096 Sep 29 14:52 inc
* drwxrwxr-x  2 nispio group    4096 Oct  1 12:53 lib
  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 mcr
  drwxrwxr-x  2 nispio group    4096 Sep 24 10:50 pyl
  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 snr
  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 unix

I have marked the directories hst, inc, and lib, and now I want to visit all files with extensions .c, .cc, and .h within those three directories and their subdirectories.

It would be even better if I could see everything that I am opening before I open it.  If the dired buffer was updated to show me all of the files that matched my search, and all of those were highlighted, I could do a sanity check to make sure that my search returned what I expected.

I am open to suggestions to do this same thing using helm or dired+ or any other extensions that will let me navigate my filesystem more easily.


texts: How can I get my target string point/marker without moving the pointer?

texts:
Lets say I have the following LaTeX code:

\ref{AAA}, \ref{BBB} ... \ref{BBB,CCC,DDD}

\begin{the bibliography}{99}

\bibitem{AAA}

\bibitem{BBB}

and I want to write a function that does:

(perform-replace "\\<AAA\\>" "\\<BBB\\>" t t nil 1 nil (point-min) BIB_BEG)

(asks if I want to change "AAA" --> "BBB" before BIB_BEG marker)

To get BIB_BEG I usually do (something like):

(let ((BIB_BEG make-marker))
  (goto-char (point-min))
  (search-forward "\\begin{thebibliography}" nil t)
  (set-marker BIB_BEG (match-beginning 0))
  ;; perform-replace stuff
  )

Now I was trying to do something like (I know it's wrong):

(let ((BIB_BEG make-marker))
  (string-match "\\begin{thebibliography}" (buffer-string))
  (set-marker BIB_BEG (match-beginning 0))
    ;; perform-replace stuff
  )

My question is, how can I get my target point/marker without moving the pointer? I already know I can use (save-excusion) to restore the initial position. In other words I was wondering if ther is a way to get the position I need with something like the string-match tecnique.


texts: Is it possible to have conditional abbrev expansion?

texts:
I have defined some abbreviations for org-mode, but I want them to conditionally expand. For example, n2 expands to N_{2}, and I want to prevent that from happening in src-blocks.

The bottom of this page: https://www.gnu.org/software/emacs/manual/html_node/elisp/Abbrev-Expansion.html suggests I should use advice to achieve this. That doesn't seem too flexible though, I don't want all abbrevs to not work in src blocks, just some.

Are there other ways to get context-specific abbreviations?


texts: org-mode link to heading in other org-file

texts:
Is there a way to link to specific topic (*) in a different
org-file?
How can I quickly find and copy the relative path from the
current org-file to the file that I want to link to?

Probably both straight forward but I couldn't figure it out.
Thanks your help.


texts: How can I expand git URL to its canonical form in magit?

texts:
In magit, if I call git-link in a buffer that is visiting a file being
version controlled, I get a github link.

Is there a way to get the canonical form of that link directly from emacs, without having to go to github and press y to get the canonical form for that link?


texts:
Here my git log:

As you can see on top window the cursor is over commit "settings". And when I enter command:

magit-reset-soft

I wait that Magit will offer me the next candidate:

Soft reset to : settings

But it not offer me this options.

Is it possible in Magit?


texts: Can I execute a code block in org-mode without exporting it?

texts:
I was following this blog about using org-mode for writing papers, and the author said

  Use C-c C-e l l to create a LaTeX file. Then, from the terminal, use
  Pandoc as follows to create an odt or a docx file.

pandoc --bibliography=biblidatabase.bib --filter pandoc-citeproc \
latexfile.tex -o outputfile.odt

Is it possible to run this shell command within the same org document?

I tried to add a bash source code block in the .org file:

#+BEGIN_SRC bash
    pandoc --bibliography=biblidatabase.bib --filter pandoc-citeproc \
    latexfile.tex -o outputfile.odt
#+END_SRC

But then, this code block showed up in the exported .odt file. This is expected, but of course, I don't want this shell command (or its output) in the final paper.

Would it be possible to suppress this code block during the export and prevent it from showing up in the exported file?


texts: How to see the name of the command every time I run it by a shortcut?

texts:
Whenever one runs a function/command for which there is already a shortcut, Emacs shows briefly a message in the echo area to recall that there is a shortcut associated with that command.

For example if I run backward-word, Emacs shows for some seconds the following in the echo area:

You can run the command `backward-word' with M-b

Is there a mechanism for the reverse of this? i.e., to recall the name of function when one uses a shortcut to revoke a command. I know by the command describe-key I can find which function corresponds to which shortcut. But it would be interesting to see the name of function every time one runS a shortcut.


texts: Custom compilation command fails on Windows due to slashes in paths

texts:
when i type on "shell":

c:\Users\TR\Desktop\emacs-27.2-x86_64\bin\GAMES\game3>love .

works fine but when i put
(defun insert-file-name ()
 (interactive)
 (let ((compilation-ask-about-save  nil))
 (compile (concat (file-name-directory (buffer-file-name)) "love ."))))

(global-set-key (kbd "C-c C-v") #'insert-file-name)

in my initialization file using "C-c C-v" gives me the error message:

-- mode: compilation; default-directory: "c:/Users/TR/Desktop/emacs-27.2-x86_64/bin/GAMES/game3/"
--
Compilation started at Sun Apr 18 23:30:16
c:/Users/TR/Desktop/emacs-27.2-x86_64/bin/GAMES/game3/love .
'c:/Users/TR/Desktop/emacs-27.2-x86_64/bin/GAMES/game3/love' is not recognized as an internal or
external command,
operable program or batch file.
Compilation exited abnormally with code 1 at Sun Apr 18 23:30:16

a similar code worked on Ubuntu emacs, but on Windows 7 it does not work!
How can i solve this problem?


texts: How to use a delayed evaluation function where a string is expected?

texts:
I have a variable that expects a string, and I want to set it to a function that will return a string whenever the variable is used.
Right now, I have
(setq bibtex-autokey-prefix-string (format-time-string "%Y_%m%d-"))

This is close to what I want, but it sets the prefix string once when my variable customizations are evaluated at startup. So the variable holds not the current date but the date when Emacs was started.
When I try
(setq bibtex-autokey-prefix-string '(format-time-string "%Y_%m%d-"))

I get the error:
Wrong type argument: characterp, format-time-string

Is it possible to do what I'm trying to do?
p.s. something else I tried resulted in a stringp wrong type argument error (I think?), but I can't reproduce that any more.


texts: Make completing-read respect sorting order of a collection

texts:
Either:

(completing-read "test: " '("a" "b" "c"))

or:

(completing-read "test: " '("c" "b" "a"))

produces the same result in completion buffer when pressing TAB. How do I make it respect the sorting order?


texts: Regexp: how to search-replace any html attribute in current buffer

texts:
Disclaimer: I'm still trying to learn elisp so I have not gotten yet to the RegExp section of the Elisp intro or Emacs manual.

I would like to know how to search and replace an HTML buffer that has elements with any number of attributes with my desired string (that to be filled by me). Basically, I need help building the RegExp that would match all the attributes that look like attr="[whatever string"


texts:
I am using GNU Emacs 26.2 and ivy from melpa.

When I run M-x and enter:
M-x magit-status

ivy suggests:

ido-enter-magit-status
magit-status
magit-status-mode

I don't use use ido, I have no idea that GNU Emacs includes, before I started use ivy. Any way to remove any ido- interactive functions from suggestion list?


texts: How to insert a piece of text in a new buffer?

texts:
I have the following code:

  (defconst cljs-test-report-buffer "*cljs-test-report*"
    "Buffer name in which to display test reports.")

  (defun cider-test-show-report ()
    "Show the test report buffer, if one exists."
    (interactive)
    (if-let* ((report-buffer (get-buffer cljs-test-report-buffer)))
        (switch-to-buffer report-buffer)
      (message "No test report buffer")))

  (defun run-cljs-test-in-ns ()
    (interactive)
    (cider-interactive-eval "(cljs.test/run-tests)"))
;; want to show this result in the ```cljs-test-report-buffer```

And I want to show the result of the run-cljs-test-in-ns function in a new buffer, that is cleared every time this function is run. How can I do that?


texts: Org-mode radio table orgtbl-to-latex :fmt wont accept float

texts:
I'd like to embed org-mode tables in my latex files and have org mode take care of formatting floating point numbers.
Based on A.6.2 of the org-mode manual (http://orgmode.org/org.pdf) I expected this to work, in particular to produce 1.0 & 2.0 \\:

\documentclass{article}
\usepackage{comment}
\begin{document}
\begin{comment}
  #+ORGTBL: SEND table-name orgtbl-to-latex :splice t :fmt (1 "%.3s" 2 "%.2f")
 | 1.000 | 2.000 |
\end{comment}
\begin{tabular}{lrr}
  % BEGIN RECEIVE ORGTBL table-name
  % END RECEIVE ORGTBL table-name
\end{tabular}
\end{document}

However, it doesn't. Instead i get an error: Format specifier doesn't match argument type

Any ideas? Is %s the only supported format or am I missing somthing? (Why?)


texts: how to turn off all the formatting and all?

texts:
When I load some log files (50mb)
When it has long json contents, emacs becomes unbearably slow.
Note the log file is simply text file which happened to have json content.
So json mode is not on.
Is there a way to turn off every formatting or other computing in emacs?
Just open a text file without any processing - mode?


texts: Search through logs by author/comitter name in magit log buffer

texts: Once I enter into the logs for a repo from the status buffer (using ll) how do I search through the log buffer by username? Just using regular isearch doesn't seem to pick up the author names in the margin. I know I can limit the commits to just a particular user using shiftL=a but I really just want to search through the authors in the margin and see where a certain set of commits by an author are relative to the other commits.


texts:
I set up an environment to write Python 3 Code in my emacs (25.2.2) using python-mode and Elpy on Ubuntu 18.04.
Strangely every time I use Python --> Send --> Execute Buffer the program is executed twice.
It doesn't matter whether I use the mapped key (F6) or go via the menu.

My code in the relevant parts (it's not doing much so far, I'm mostly trying to learn using emacs as an IDE):

import sys

class MyClass:
    def __init__(self, argv):
        # Does something...

    def __call__(self, x):
        print("Call was called") # But is never called

if __name__ == "__main__":
    print('~~~~Start~~~~')
    # Does not much more
    print('~~~~End~~~~')

The result looks like that:

>>> ~~~~Start~~~~
~~~~End~~~~
>>> ~~~~Start~~~~
~~~~End~~~~

Disclaimer: I'm very new to emacs, so please excuse if the question doesn't have enough information. I'm willing to provide - just need to know how.

Edit (1):
Tried to run a simple Hello world program:

if __name__ == '__main__':
    print("Hello World")

Same result:

>>> Hello World
>>> Hello World


texts: How to change octal sequences into utf-8 text

texts:
When I copy non-ascii text from Windows and paste into Emacs, it shows up as an octal sequence. For example, if I paste ä into Emacs it shows up as \344.

I could type C-q 344 to get the ä back in Emacs. That's annoying, but it's tolerable if there's only one character. But if there are many characters turned into octal escape sequences, it would be convenient to run some command on a region to convert everything inside. Is there already such a command? If not, how would you write a function to do it?

[I set my default coding system to utf-8 in my .emacs file, and I use the same .emacs file on Windows and Linux. But the problem only happens when copying from a Windows application into Emacs. Copying from Emacs to another Windows application works fine.]


texts: how to use the STRING parameter in put-image?

texts:
I want to temporarily insert an image and a newline in the buffer, all using put-image.  That is, I want the buffer to look like this:

[IMAGE]
\newline

I want the newline to be part of the overlay.

I understand that the third parameter (STRING) in put-image can be used to achieve that effect.  But I am not sure about how to set that parameter.  The code I have unsuccessfully tried is this:

(put-image (create-image "image.gif") (point) #(" \n" 0 1 (display)))

For which I get the error "Odd length text property list". What am I doing wrong?


texts: Is arbitrary buffer position at the beginning of a line?

texts: What's the simplest way to check whether a given point value p is at the beginning of some line or not? Is there anything simpler than (save-excursion (goto-char p) (= p (point-at-bol))) or (member (char-before p) '(nil \n))?


texts: Once I have pushed a mark into the ring with C-c %, org-mark-ring-push and have cycled through the ring with C-c &, org-mark-ring-goto, how can I remove a mark that I don't need anymore? I tried C-u C-u set-mark-command-repeat-pop but nothing happens.


texts: How to paste from clipboard litterally into emacsclient within an ssh session?

texts:
This is a long-standing problem that I haven't found a solution for months. I sometimes copy text or snippet from somewhere relse and paste into my emacsclient in the Terminal by Ctrl + Shift + V (Gnome Terminal, Linux). Emacs frequently interferes with this pasting by triggering arbitrary commands. This breaks the pasting job, and may also be a security risk.

For example, this content:

head -n1 ucsc.refseq.txt >refseq.sorted.txt

would be trucated to head -n1 ucsc.re and send eq.txt >re to some other command (i.e. switch buffer). The eq.sorted.txt disappears. And the fs parts were interpreted as some command/mt macro that I can't find from any exposed emacs function.

I tried with clipboard-yank, pasting produced different result but still not complete content I want to paste.

So, how do I make emacs paste literally all of my clipboard content, without triggering anything?

If it helps anything: my emacs version 24.5 with spacemacs configuration.

Update:

Some more background information:
The problem here is that I use my local computer to select and copy text. Then I paste into emacsclient with the ssh. This means the my local clipboard's content has to be transferred to the remote server letter by letter, not the normal way of clipboard handling. And that causes the problem.


texts: How to link to a LaTeX label within align* environment in Orgmode?

texts:
I am using org mode to write documents with math, and then exporting to latex. Consider an unnumbered align environment with two equations:

\begin{align*}
x = 1\\
y = 2
\end{align*}

Now, number the second equation using, for example, \addtocounter{equation}{1}\tag{\theequation}}, and then label it:

\begin{align*}
x = 1\\
y = 2 \addtocounter{equation}{1}\tag{\theequation}} \label{ref_me}
\end{align*}

Question: How can I link to ref_me in org mode so that:

Exporting to latex works
The link is clickable within org mode (just like with a [[]] reference)

In other words: how to reference an equation within the align environment so that it works when exported to latex, and so that anyone viewing the org file can click on the link and be taken to the equation.

Thanks   for your help and for your time! :D


texts:
Given the file test.c:

int main()
{
    if (a)
        foo();
    else
    if (b)      // line 6
        bar();
    else
        baz();
}

Whenever a comma or paren is typed while point is on line 6 (second if), Emacs reindents the line one indent level deeper, i.e.:

int main()
{
    if (a)
        foo();
    else
        if (b)
        bar();
    else
        baz();
}

Is there any way to disable this annoying behaviour just for this situation?

I'm aware that I could use else if on one line instead of putting else and if on separate lines. However:

I don't like this style, as the if conditions are no longer aligned
I'm working on existing projects with an existing code style
The editor should not dictate the code style anyway.

I'm aware that I could disable electric indentation entirely, however this disables useful behaviour such as correct indentation after typing { and }.
The Emacs manual lists which characters trigger electric indentation:

  The electric characters are {, }, :, #, ;, ,, <, >, /, *, (, and ).

However, there is no mention of any way to customizing them. I think leaving just { and } would be fine.


texts: :tstart and :tend not having any effect in org-clock-table output?

texts:
I tried to specify :tstart and :tend in my clocktable block according to the official documentation, e.g.
#+BEGIN: clocktable :scope agenda :maxlevel 6 :stepskip0 t :fileskip0 t :compact t :link t :tstart "<2020-12-27 Sun 06:00>" :tend "<2020-12-28 Mon 06:00>"
I also tried a minimum example of #+BEGIN: clocktable :tstart "<2020-12-26 Sun 06:00>" :tend "<2020-12-27 Mon 06:00>"
However, only the clock entries from today seem to be produced. The :tstart and :tend are always ignored, for whatever reason.


texts:
Running Emacs 25.2.2 on Kubuntu 18.04.

I installed EMMS from the package archive.

Added:

(require 'emms-setup)
(emms-standard)
(emms-default-players)

to my init.el as suggested here.

On restarting Emacs, it produces an error:

  Symbol's value as variable is void: emms-playlist-mode-map

So, something is wrong. What is it? How do I get EMMS to work?


texts:
I've written a command that ssh-es to a remote host and runs an interactive command there.  Something like:

(defun remote-command ()
  (interactive)
  (pop-to-buffer (get-buffer-create "*remote-command*"))
  (async-shell-command "ssh remote-host interactive-command" (current-buffer)))

A longstanding annoyance has been that when I enter a very long line, some portion of the end of the line is echoed back before the command line is executed by interactive-command.  The main notable consequence, aside from screen clutter, is that if the end of the line contains an odd number of quotation marks, electric-pair-mode gets confused and no longer inserts matching pairs when I type a quote.

When I try running this ssh command from an OS X Terminal, I see similar behavior, except that the echoed portion is everything but the first physical line that the terminal presents.  I discovered by accident that if I give ssh the -t option in Terminal, the echoing stops completely.  I tried adding that option to my Emacs command, but it makes no difference.

That's that I've tried that have made no difference:

stty -echo before running interactive-command
Setting the TERM environment variable to various settings before running interactive-command, eg: vt100, dumb
Setting comint-process-echoes to t

If it makes a difference, interactive-command is actually spark-shell.

Help?


texts: How to reuse org-tree indirect buffer windows?

texts:
So I would like to use the function below. The problem is that if I call this multiple times another window opens instead of the window that already exists.
All the buffers that are created look like this "XXXXXX-1" So the second call would look like "YYYYYY-1"

Below the function is a block of my init file that deals with problematic windows, but I'm not able to find a buffer name definition that catches the scheme. I assume I need some regexp magic which I'm not able to cast. Is there some wizard who can help me out?

(defun my-org-tree-open-in-right-window ()
  (interactive)
  (org-tree-to-indirect-buffer)
  (windmove-right))

_

   (setq display-buffer-alist
        '(
          ("*Org Lint*" . ((display-buffer-use-some-window) (inhibit-same-window . t)))
          ("^\\*Woman"  . ((display-buffer-use-some-window) (inhibit-same-window . t)))
          ("^\\*Man"    . ((display-buffer-use-some-window) (inhibit-same-window . t)))
          ))
  (add-to-list 'same-window-buffer-names "*Apropos*")
  (add-to-list 'same-window-buffer-names "*Backtrace*")
  (add-to-list 'same-window-buffer-names "*Info*")
  (add-to-list 'same-window-buffer-names "*Messages*")
  (add-to-list 'same-window-buffer-names "*Shell*")
  (add-to-list 'same-window-buffer-names "*Summary*"))


texts: Make a buffer-local variable become global again

texts:
I was experimenting with local variables and set:

(defvar-local foo nil "Buffer local foo")

I later redesigned my program to use a global variable instead using:

(defvar foo nil "Not buffer local foo")

but the variable is still buffer local and even (kill-local-variable 'foo) didn't kill it.

Basically, how can I "undo" make-local-variable?


texts:
I had to reinstall my OS but I made a backup of my .emacs.d. Then, once the new OS was installed, I copied it back and installed all the fonts. This time however, the scaling is really small! With the same .emacs.d, OS, machine and the fonts my Emacs scaling was fine before. emacs -Q is also tiny. lsb_release -a returns,
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal

Here is how I installed it,
usr@machine:~$ apt policy emacs27
emacs27:
  Installed: 27.1~1.git86d8d76aa3-kk2+20.04
  Candidate: 27.1~1.git86d8d76aa3-kk2+20.04
  Version table:
 *** 27.1~1.git86d8d76aa3-kk2+20.04 500
        500 http://ppa.launchpad.net/kelleyk/emacs/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

Here is how it looks,

Other people have had this issue and suggested solutions include changes to the init files but I ran this same init file on the same distro and things were fine. So what changed must be outside of my init?
Edit:
Instead of emacs27, I installed emacs, i.e.,
emacs:
  Installed: 1:26.3+1-1ubuntu2
  Candidate: 1:26.3+1-1ubuntu2
  Version table:
 *** 1:26.3+1-1ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
        100 /var/lib/dpkg/status

This scales fine!
Edit 2:
I am using Iosevka. Note that the with the same font and init file, Emacs from Ubuntu's repositories renders fine.


texts: How to setup keyboard for Normal mode in Evil [dvorak user]?

texts:
I am using a dvorak keyboard and Evil Mode. I would like to keep the qwerty keys while in Normal mode. And wonder if there is a more efficient way than remapping everything.

I found this post that looks like it takes the opposite route: setting dvorak only for the Insert mode. It looks fine for somebody who use dvorak layout only in Emacs but not enough if I have dvorak set as my keyboard for the whole OS.

Is there something similar to

(activate-normal-method "qwerty")

that I could use on an OS set to dvorak as its default keyboard?


texts: My terminal emacs displays weird characters (\u2506) for unvisiable characters in buffers

texts:
I'm currently in a new environemnt, my emacs in terminal displays weird character in files, GUI Emacs works fine. I don't know how to express this, please see the following details:

Text edition:

#include <stdio.h>

int main()
{
\u2506        printf("hello world\n");
\u2506        return 0;
}

Image edition:
https://i.stack.imgur.com/b5f0p.png

This "\u2506` characters are displayed in all files I've tried, and the files are displayed correctly in other programs such as vim or less.

I believe this is the problem of my new OS, since it works fine in another environment, and I got the same TERM(screen-256color+tmux) and SHELL(fish shell) in both environments.

How can get this fixed? If you need any info, pelase let me know.


texts: The dirtree mode not present installed using melpa

texts:
My Emacs version is 25.2.2.

I installed dirtree using melpa. But M-x dirtree is not there.


texts: Insert continuation of a string to a new line (emacs/spacemacs)

texts:
I often have long strings I want to break into new lines in various languages. E.g. in python

x = ("The quick brown fox jumps over the lazy dog")
                         /\ cursor here

becomes

x = ("The quick brown fox "
     "jumps over the lazy dog")

Or in javascript

var x = "The quick brown fox jumps over the lazy dog."
                            /\ cursor here

becomes

var x = "The quick brown fox " +
        "jumps over the lazy dog."

Is there a way to do this in vanilla Emacs or Spacemacs?


texts:
I'm using emacs on MAC OSX

ELISP> (emacs-version)
"GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95))
 of 2019-09-06"

ielm REPL echoes back the octal, hex and character representation when entering an integer less than or equal to 127:

ELISP> 81
81 (#o121, #x51, ?Q)
ELISP> ?a
97 (#o141, #x61, ?a)

But when using unicode chars like for example lambda ('λ') I get only the number 955

ELISP> 955
955 (#o1673, #x3bb)
ELISP> ?\N{Greek small letter Lamda}
955 (#o1673, #x3bb)
ELISP> ?\u03bb
955 (#o1673, #x3bb)

Since Emacs support full unicode, (you need to use Symbola or some similar font), it should be possible for ielm to echo back the actual glyph for the character:

ELISP> (concat '(?I 32 955 32 ?\u2665 32) "Emacs")
"I λ ♥ Emacs"


texts: org-mode-agenda is taking too much screen estate

texts: Is it possible to change the size of org-mode-agenda on opening so that when opening the agenda, it doesn't open so large (saving me having to resize it)?


texts: Why is tab-width reset when I open a C++ file?

texts:
So I'm trying to setup default indentation in Emacs. Currently I have the following at the bottom of my .emacs file as per a number of tutorials I've found on the internet.

(setq-default indent-tabs-mode nil)
(setq tab-width 3)
(defvaralias 'c-basic-offset 'tab-width)
(defvaralias 'cperl-ident-level 'tab-width)
(defvaralias 'js-indent-level 'tab-width)

Except... it doesn't work; when I open a C++ code file, tab-width appears to be set to 8. Can someone tell me why this is, and also what I need to do to fix it?


texts: Default file extension for `dired-do-rename`

texts:
I am wondering how to make renaming files in dired to use the current file extension as the default.

For example, imagine I run dired-do-rename on the file foo.bar and then type foo2 and press Enter. I would like the result of this operation to yield the file foo2.bar in my directory.


texts:
I want to check the spelling in a buffer. I do that by M-x  ispell. When it finds nd in the folowing example:

apple a nd orange

I hit the left or right arrow key, in order to move the cursor to the space after a in the buffer and then delete the extra space between a and nd. But it seems that I exit ispell when I hit my arrow key. How can I do my edit without exiting ispell?

Currently, if I restart M-x ispell, it will start from the beginning of the buffer, rather than from where I was last time. To start from where I was last time, I select the region from where I was to the end of buffer, and then M-x ispell.

How can I continue from where I was left last time more efficiently?


texts: Is there a linux terminal with emacs keybindings?

texts:
I sometimes need to work in a terminal. E.g compile gtk.

I found that the native emacs shell doesn't quite do what a native terminal does. And anyway I'd like to keep them two separate.

Now, is there a terminal that has a similar feel as emacs? like C-x-3 to slip windows etc..

(e.g for firefox there are firemacs bindings, for eclipse there is emacs+ plugin) etc...

[Edit]
If you down vote, please leave a comment explaining why so I can improve question.


texts: Prevent mouse click in inactive frames from reposistioning point

texts:
I want to prevent the "first" click on a frame in an inactive X window from having any effect, other than to make the frame active.  Specifically, I don't want it to reposition point.

The problem is that I can't seem to detect that he frame was inactive when I get the mouse click.  So the following code always shows "y":

;; detect if frame is active when clicking
(defun my/mouse-drag-region (event)
  (interactive "e")
  (mouse-minibuffer-check event)
  (let* ((window (caadr event))
         (frame (window-frame window)))
    (if (eql frame (selected-frame))
        (print "y")
      (print "n"))))
(global-set-key [down-mouse-1] 'my/mouse-drag-region)

How do I detect that the frame was previously inactive?

Or, has someone already achieved what I am trying to do elsewhere?

Note: I am asking for something different than this other question, which is about inactive windows, not inactive frames.


texts: Since Emacs 25.1, package-list-packages modifies and writes my .emacs

texts:
I've just installed Emacs 25.1. My .emacs works well on Emacs 24.5. But now that I'm on Emacs 25.1, when I do M-x package-list-packages, Emacs modifies and write .emacs in the background with the following modifications in custom-set-variables and custom-set-faces :

(custom-set-variables
 '(package-selected-packages
   (quote
    (yaml-mode w3m toml-mode thing-cmds slime-company rust-mode revive proc-net paredit monky minibuf-isearch markdown-mode magit list-processes+ imenu-list google-this ggtags expand-region emacs-cl elnode elisp-slime-nav company-c-headers common-lisp-snippets column-enforce-mode cl-generic cl-format aggressive-indent))))

and that :

(custom-set-faces
 '(default ((t (:height 110 :family "Monospace")))))

How can I prevent Emacs doing this ?


texts: How do I turn off highlighting for $...$ in tex-mode

texts:
I like to use highlighting when working with emacs.  But I don't like some of the default settings.  I recently installed emacs 24.4 on my iMac.  I really don't like all the highlighting of math expressions such as

$5$

I used to do something like

(fset 'tex-font-lock-syntactice-face-function 'ignore)

or

(fset 'tex-math-face 'ignore)

but that no longer works.

How can I disable highlight for math expressions but keep most everything else?


texts: How to tell Ido to get out of the way when I can already just paste the file name?

texts:
I'm trying to make myself use Ido mode. Some times it's nice, but other times it is extremely stupid. Here's my greatest disappointment.

I read some log with full file names, then I copy one name, try open that file.

The way to do this without Ido: C-aC-yC-kRET

With Ido there are two major problems:

If I have the entire file name, there's no way to input that (I must remove the first slash, else even pressing // will not help.
I can't edit intermediate parts of the file name leaving the rest unmodified.

Or can I?


texts: Use font-lock mode on only part of buffer

texts:
I am trying to add a comment feature to Pod documentation for Perl scripts, and I would like to highligh Pod comments with a special face. A simple prototype Perl script could be:

#! /usr/bin/env perl

use strict;
use warnings;

print "Hello\n"; # a Perl comment /* hello */

__END__

=head1 SYNOPSIS

my_program <arg1> [OPTIONS]

/* this is a Pod comment */

As we see, a Pod comment is surronded by /* */ as in C programming language. However, only the part below the line __END__ is Pod documentation. The part above that line is regular Perl code. Now, if I try to add syntax highlighting to the Pod comment using for example (called from cperl-mode-hook):

(font-lock-add-keywords nil '(("\\(/\\*.*?\\*/\\)" 1 'font-lock-warning-face t)))

I get the following using cperl-mode as major mode:

So Pod comments are highlighted also in a regular Perl comment (a Perl comment starts with a # character), which is not desired (Pod comments should only be highlighted in Pod sections, not in regular Perl code).

For simplicity, for this question, we can assume that the Pod documentation is confined to the end of the document, starting with the lines after the __END__ tag. Is it possible to check the position of the current comment and relate that to the position of the __END__ line, and from that information determine if we are inside a Pod block or not (and then add syntax highlighting only if we are inside a Pod block) when running the font lock code?


texts: Starting daemon without forking to background

texts:
I want to run an Emacs daemon under daemontools.  So I need to create an Emacs process which

Basically does emacs --daemon
Does stay in the foreground
Displays the Messages buffer (or some other logging info) on STDOUT

I have no clue how to do this, so would appreciate any pointers.


texts: Tramp recreates /dev/null as a regular file

texts:
The default tramp history file is /dev/null, which is a big problem because tramp recreates its history file as a regular file when it hits history limit, which is rather annoying.

I tried to override the path variable for the history file with:

(package-initialize)
(require 'tramp)
(defvar tramp-histfile-override "~/.tramp_history" "Prevent tramp from using /dev/null and recreating it as a regular file when history size is reached.")

according to: .tramp_history files

I used defvar because there is no such a variable as tramp-histfile-override

and it is not working. Well the funny thing is that I know a solution:

Change the HISTFILE value from /dev/null to something more sane in tramp-sh.el

@@ -3865,7 +3865,7 @@ file exists and nonzero exit status otherwise."
       ;; the prompt in /bin/bash, it must be discarded as well.
       (tramp-send-command
        vec (format
-       "exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"
+       "exec env ENV='' HISTFILE=~/.tramp_history PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"
        (tramp-shell-quote-argument tramp-end-of-output)
        shell (or extra-args ""))
        t))
@@ -4587,7 +4587,7 @@ connection if a previous connection has died for some reason."
        (delete-process p))
          (setenv "TERM" tramp-terminal-type)
          (setenv "LC_ALL" "en_US.utf8")
-         (setenv "HISTFILE" "/dev/null")
+         (setenv "HISTFILE" "~/.tramp_history")
          (setenv "PROMPT_COMMAND")
          (setenv "PS1" tramp-initial-end-of-output)
          (let* ((target-alist (tramp-compute-multi-hops vec))

Question: Are there any other ways without modifying the Emacs source code?


texts: What's a good workflow for having a few dedicated shell sessions?

texts:
At present I use a screen session in the terminal (outside of emacs), with window 0 devoted to running my web server, window 1 to running tests, and window 2 for general hacking. I like this flow and want to keep something similar. I was wondering a way to emulate this on emacs.

I should always have one frame devoted to exactly one of these three windows (on the bottom) and there should be some way to cycle through them. I don't really want these windows getting mixed up in the rest of my windows. Arguably this is a good use case for another frame, but that sends me back to using screen or something to manage and I was experimenting with getting away from this utility.

The next option is (somehow - still learning) setting up perennial buffers and being able to access them via the buffer list. Still scatters them around; not great.

My other reasonable solution is to run a screen inside a shell and anchor the window. Not crazy, but still have the problem of nested control characters and stuff.

Any good solution here?

In particular this creates a window reserved for basically a full emacs session inside a window, and in fact I could just nest it inside a shell, but obviously the key bindings basically go to oblivion and back.


texts:
I'm struggling to run fzf in emacs but cannot figure out whats my problem. When I run fzf - and start typing - text gets mess up, similar to this:

I tried run fzf in term, eshell, ansi-term, multi-term modes, with and without --color=no option, its all the same. Does anyone knows what is my problem could be? Thx.


texts:
I use company-irony for C++ code completion. I have deleted the company-semantic backend from company-backends in my init.el.

Now I want to use Semantic and specifically the global-semantic-stickyfunc-mode to display current function at the top of the frame (this is useful if the function spans more than one frame). I enabled this in my init.el and it works.

So far I haven't noticed any problems with using Company and Semantic concurrently like this. Does anybody know if this might cause problems?


texts: How to delete org-mode table separator | quickly?

texts:
If I have the following text:

Name  Score
Bob    87
Ted    99
Mary   78

I know C-c | will covert it to org table. But how can I do the other way around?

If I have a org table already, how can I convert it to text block?

I originally thought I could use multiple-cursor to delete, but this is not that effective if the table is huge.

Anyone any ideas? Thanks


texts: Use system-installed package with spacemacs that depends on MELPA packages

texts:
How can I include a package that is available locally on my system that depends on the string library s with spacemacs?

I have an company internal package that adds functionality to magit available at /usr/share/emacs-config/neat-tool.el

neat-tool.el is something like:

;;; neat-tool.el --- Use neat tool

(require 'magit)
(require 's)
(magit-define-popup-action 'magit-dispatch-popup ?x
   "Neat commands"
   'neat-commands-popup)

I have a custom layer called my-layer with a packages.el of:

(defvar my-layer-packages
  '((neat-tool
     :location (recipe
                :fetcher url
                :url "file:///usr/share/emacs-config/neat-tool.el"))))

(defun my-layer/neat-tool ()
  "Init neat-tool."
  (use-package neat-tool
    :defer t
    :init
    (with-eval-after-load 'magit
      (require 'neat-tool))
    ))

Unfortunately, this fails with Cannot open load file: No such file or directory, s.  s is correctly installed and up to date in ~/.emacs.d/elpa

I could wrap another with-eval-after-load in the :init, but that seems messy.  Is there a better way to declare the dependency on s?


texts: how to open all files from specific path as read-only buffer

texts:
I am looking for a way to open all files from $MYPATH (for instance) as read-only buffer by default. And all rest of the files should be opened as normal buffer (I mean, not read-only buffer). Does anyone know how to do this? Cheers.
- A still naive EMACS lover


texts: How to alias a function with argument by defalias

texts:
I want to chnage input method by M-x ru.
But I couldn't figure out how to alias a function with argument.

This is what I tried:

(defalias 'ru '(set-input-method russian-computer))

How can I alias a function with argument?


texts: eshell print time and exit status for every command

texts:
fish shell (and zsh) let you register commands that run before and after every command.

I have my shell configured to print the exit status if nonzero and the amount of time taken to execute the command in seconds if longer than 10 seconds.

Here's an implementation of that behavior in fish

# ~/.config/fish/config.fish

# set a global variable to the current epoch time in seconds
# before executing any comment
function get_start --on-event fish_preexec
    set -g cmdstart (/bin/date '+%s')
end

# inspect previous exit status, write "Exit n"
# where n is a non-zero exit status
function show_exit_status
    switch $status
    case 0
        true
    case '*'
        echo "Exit $status"
    end
end

# compute the time in seconds since the command was started.
# print it if the time exceeds 10 seconds
function show_time_consumed
    set taken (math (/bin/date '+%s') - $cmdstart)
    if math $taken '>=' 10 >/dev/null
        printf 'Time: %ss\n' $taken
    end
end

# show the time consumed and the exit status
# after the command is run
function postcmd --on-event fish_postexec
    show_exit_status
    show_time_consumed
    echo
end

And an example of what it does

> sleep 14
Time: 14s

sleep 14; /bin/false
Exit 1
Time: 14s

I'm trying to figure out how to emulate the same behavior in eshell.

Here's my initial attempt to port it:

(setq inhibit-startup-echo-area-message "USERNAME")
(setq inhibit-startup-message t)

(defvar eshell-current-command-start-time (float-time))

(defun eshell-current-command-start ()
  "store the current starting time"
  (setf eshell-current-command-start-time (float-time)))

(defun eshell-current-command-stop ()
  "write the stopping time"
  (let ((the-time (float-time)))
    (message (number-to-string
           (- the-time eshell-current-command-start-time)))))

(add-hook 'eshell-pre-command-hook #'eshell-current-command-start)

(add-hook 'eshell-post-command-hook #'eshell-current-command-stop)

It has some problems that hamper its usefulness.

When you hit enter after an empty command, the post-command-hook
runs, but the pre-command-hook does not.
Neither message nor print write to the eshell buffer.

Is there a straightforward way of grabbing the time using float-time before and after every command executes (including empty commands) and displaying it in the buffer the same way that the output of a command would be displayed?


texts: How can I setup the tab indentation size for ***-mode (Rust, Python, Ruby, etc)?

texts:
I have rust-mode installed on my Emacs 24.4. The tab indentation I have is 2 whitespaces, however in Rust mode it's different. I want to setup  the tab indentation size for rust-mode, how can I do that?

And actually, not only for rust mode, for other languages such as Python too.

UPDATE:

Or I think it's better for me to setup it globally regardless of the setting for each **-mode package.


texts: Capturing screenshot in org-capture buffer

texts:
I am planning to insert screenshot in org-capture buffer.

I have a function that can create a screenshot image in a images subdirectory of current directory. However, since the org-capture buffer is an indirect buffer, the buffer-file-name result is nil, it can not create the subdirectory directly.

So how can I get the original buffer path in org-template, save the screenshot in the images, and insert it to the org-capture buffer?

Of course, I can just finalize the org-capture buffer, go to the save place, and call screenshot function there. But it is kind of cumbersome, which i do not like very much. Please give me some hint if you have some idea. Thanks very much.


texts:
Similar to the somewhat neat, but in the end too clunky, hydra-goto-line, I'd like to customize goto-line to enable linum-mode, but only during the function call.

I tried add-advice, :before and :after, but nothing kinda happened. So what's the proper way to enable a minor-mode during a single function call?


texts: How to reference a local variable inside the definition of a function?

texts:
Is it possible to reference a local variable inside the definition of a function? Here's an example:

I have an alist text-alist consisting of keys and text snippets. I want each text snippet bound to a key in the prefix map my-text-prefix-map. The code below doesn't work, I guess because when the functions in my-text-prefix-map are run, the value of text is unknown. Is there any way to remedy this?

(mapc (lambda (text)
        (define-key my-text-prefix-map (kbd (car text))
          (lambda ()
            (interactive)
            (insert (cdr text)))))
      text-alist)


texts: Emacs always ask to trust colour theme at startup

texts:
My Emacs always prompts me if it should trust selected colour theme or not. I always answer y and y to trust and remember my choice. I'm loading colour theme manually:

(load-theme 'my-favourite-theme)

I suppose this is because easy customizations are placed below colour theme loading. Is it some way to fix it? Or should I just delegate colour theme loading to easy customizations too?


texts: Revert all open buffers (and ignore errors)

texts:
When working on a project under version control with git, I often want to do some things in a shell that affect many of my open files, then revert every buffer that I have open to make sure that I don't accidentally clobber the new version with whatever I had open. I know magit can be helpful here, but I'm used to my workflow in the shell and I'd like to keep it for now. So instead, I'd like to revert all open buffers, and maybe close any that have stopped existing (e.g. because of a git checkout of a branch that no longer has that file).

I have the following snippet of elisp that I grabbed from a Google search:

(defun revert-all-buffers ()
  "Refreshes all open buffers from their respective files"
  (interactive)
  (let* ((list (buffer-list))
         (buffer (car list)))
    (while buffer
      (when (and (buffer-file-name buffer)
                 (not (buffer-modified-p buffer)))
        (set-buffer buffer)
        (revert-buffer t t t))
      (setq list (cdr list))
      (setq buffer (car list))))
  (message "Refreshed open files"))

But this breaks if it hits an error in one of my open files, i.e. when reverting B1, B2, B3,...,Bn an error while trying to revert B2 prevents B3-Bn from being reverted.

How can I tell emacs to ignore any errors that pop up in this case? I don't want to use global-auto-revert-mode because each revert triggers some heavy duty stuff like my auto-complete and syntax checker re-parsing the file, hanging emacs for a second or so.


texts: Org-agenda: how to show todo's with scheduled date within a time interval?

texts:
I want to use org-agenda to show todo's with scheduled date or deadline date within at certain time interval. For instance, I want to show todo's with deadline between today and one week ahead (today +7d). I have tried to do this by the following code:

 (setq org-agenda-custom-commands '(
   ("d" "daily "(
     (tags-todo "+DEADLINE>=\"<today>\" +DEADLINE<=\"<today + 7d>\" (
        (org-agenda-sorting-strategy '(todo-state-down))
        ))
  ))))

But the code does not give what I want, instead my agenda show all todo's with deadline in the future, not only those with deadline between today and one week forward. How can I make org-agenda only show todo's for a certain time interval? Thanks for any answer :)


texts:
How can I get emacs to save the buffer automatically every time I switch to another buffer?

(This is similar to this question, where the buffer is saved automatically when Emacs loses focus.)


texts: emacs 25.3 not rendering correctly, especially after resize

texts:
The problem is when emacs starts, the right 1/4 of the window doesn't repaint and shows whatever window was behind it.

Also on resize, sometimes the font and the cursor get way too big and the minibuffer disappears (see attached).  Resizing it again gets the font back to normal, but then sometimes the minibuffer and status bar don't draw at all.

On linux minty 18.3 (Ubuntu Xenial) with HiDPI enabled.  Nvidia video driver the latest long term version.

I configured with flags ./configure --with-mmap  --with-x-toolkit=gtk3  --with-cairo   --with-modules  and did make/make install as normal.

edit:  The problem I would like to solve is this rendering issue.  emacs 24 renders and repaints just fine.


texts:
What functionality is available in emacs to get information about a keyboard macro?
Even something as simple as printing out what the macro evaluates.


texts:
I tried to find an answer to this seemingly simple question, but the swamp (internet) is a big place.

In the emacs init file in one case I use: (show-paren-mode t)

In another case I use:
(set 'inhibit-startup-message t) or (setq inhibit-startup-message t)

Why do I need to use setq in one case to set a Boolean?


texts: org-capture scheduled for next Tuesday (or Friday)

texts:
I'd like to create a capture template that automatically schedules the date for the upcoming Friday (if today is a Tuesday, Wednesday, Thursday) or for the upcoming Tuesday (if today is a Friday, Saturday, Sunday, or Monday).

Any ideas are much appreciated.


texts: The global value of a variable I set with setq in my config differs from the local value. How can I get my value to be what I want in every buffer?

texts:
I want web-mode-script-padding to be set to 0 at all times.
In my config, I have tried both

(with-eval-after-load 'web-mode
 (setq web-mode-script-padding 0)
 )

As well as simply,

(setq web-mode-script-padding 0)

If I open a new window, and then a webmode file, the behavior of pressing TAB and other things indicates that the value is not set how I want it to be (this after reset so my new config is reloaded). So, I do M-x describe-variable web-mode-script-padding. I see:
web-mode-script-padding is a variable defined in ‘web-mode.el’.
Its value is 2
Original value was 1
Local in buffer Navbar.vue; global value is 0

This is not what I want. I want the value to be 0.
So I do M-x set-variable web-mode-script-padding 0 in that buffer. Now, describe-variable shows
web-mode-script-padding is a variable defined in ‘web-mode.el’.
Its value is 0
Original value was 1
Local in buffer CardList.vue; global value is the same.

Furthermore, in this buffer, the script-padding behaves as I want.
However, opening a new buffer means I have to manually set-variable again to maintain this behavior.
How can I either set-variable so it applies to the entire frame, or get my setq in my config to "stick?"
Edit: In case this was a buffer-local variable, I tried setq-default, still not getting the desired behavior though.


texts: Company won't complete at the beginning of org mode headline

texts:
For example, with the given text
* algorithm
* algo<cursor>

Fun company-complete it won't complete the word aglorithm.
If the cursor is not at the beginning of a headline, then completion works as usual.


texts: yasnippet: jump at the beginning of inserted snippet

texts: Is it possible to define that after inserting a snippet, the cursor will jump at the beginning of what has been inserted? It will make it even more fun.


texts: How do I add the following key bindings to my Emacs startup script?

texts:
I'm learning Clojure.

Every day, I open up Emacs and key in the following commands:

C-x 3 ; create a new window on the right
M-x cider-jack-in ; open up a REPL
C-x o ; switch to my left window
C-x C-f code/clojure-projects/something.clj ; open up a file and start coding

I would like to automate these, so that they automatically happen every time Emacs starts.

To do this, I need to add something to the bottom of my ~/.emacs.d/init.el file, right?

I would also like to know the process by which I can figure out how to do these things in the future.


texts: org-id-find-id-in-file function definition is void?

texts:
After re-arranging my spacemacs configuration file, I'm now getting

Symbol's function definition is void: org-id-find-id-in-file

After running a custom function that makes use of this symbol.

I cannot pin down what change is causing this; moreover, this looks like a stock symbol so it's bothering that it's definition can't be found.

How to fix this?


texts: How to save clipboard or (car kill-ring) as string

texts:
OS Debian GNU/Linux 7
emacs-24.3

I want to save the content of the clipboard or the last item of the kill-ring (depending whats newer) as a string so that I can do stuff with it in a eLisp function. At the moment I use this:

  (setq zwischenablage (car kill-ring))

I have 2 problems at the moment:

When the text was copied in emacs and was highlighted something like "#("Wechseln" 0 8 (fontified t face font-lock-doc-face))" is saved in the string. For some reason yank-handled-properties seems not to be applied.
When I copy text from outside emacs like the browser or so it is not used. I have to yank it and after this my function works fine.

Does anyone know any solution for these problems?


texts: Is there a way for a display-buffer-base-action function to know the forthcoming major-mode?

texts:
I am writing a mode that implements a persistent horizontal window (very similar to the "persistence compile window" in ECB).  While I did study the ECB code it is quite old and endeavored to work with even more ancient verions of emacs.  I am trying to write code the makes use of the many recent enhancements to emacs' windowing system.

It would appear that display-buffer-base-action is exactly the point in display-buffer's processing sequence to hook in my window management smarts.  I am able to classify newly created buffers base on buffer-name (e.g. Completions) and on whether of not they are related to a live process (using comint-check-proc).  What I cannot do is classify a newly created buffer base on its ultimate major-mode.  This is because when display-buffer is called on a newly created buffer that buffer's major-mode has not yet been set.

Is there any way to "peer into the future" to determine what major-mode will later get established?


texts: Emacs on cygwin: How to open file/directory on windows share

texts:
With Emacs running on Windows (without cygwin) I am able to open a remote (windows share) directory with C-x C-f //IPADDRESS/d$ RET command. With Emacs on cygwin, I tried /smb:IPADDRESS:/d$$ RET. However, I got the below error message,

Host 'IPADDRESS' looks like a remote host, 'smb' can only use the local host.

The earlier //IPADDRESS/DIR syntax too didn't work.

Can anyone please help (I also tried using my username in the smb URL but got the same error)?

EDIT: I found out from the post https://superuser.com/questions/102233/how-to-go-to-remote-directory-in-cygwin that cygwin treats UNC paths as local. More information is at https://www.cygwin.com/cygwin-ug-net/using.html#unc-paths. So the solution is to do C-x C-f //machine/shareddir RET to browse the remote directory assuming you don't have to provide different credentials.


texts: How do I make lsp-mode ignore a node_modules folder + others?

texts:
I want to know how to make lsp-mode ignore a node_modules folder (along with say, folder asdf and temp). This is what I have:
(setq lsp-file-watch-ignored (rx (or "node_modules" "asdf" "temp")))
but for some reason it is not working. This official link says that lsp-mode uses a regex for lsp-file-watch-ignored, but the error I am getting seems to imply that it is expecting a list. What am I doing wrong?


texts: Sorting org files in Emacs Dired on the basis of the org time stamp in the file itself

texts: Is there a way of sorting org files (.org) in Emacs Dired on the basis of the org time stamp in the file itself. With every org file I create, I insert an org time stamp near the top of the file. This time stamp may or may not reflect the day on which the document was created or last modified. For e.g. if I have to give a lecture, the org file is dated to the day of the lecture. I am aware that Dired generally uses the ls program.


texts: I would like to understand what is the difference between M-x shell and M-x term? Also under which circumstances should be used the first and under which the second?


texts: js2-mode: Highlighting and syntax checks only update when the buffer or mode is refreshed

texts:
As I'm typing into my buffer in js2-mode, the syntax is not being updated and all my new code is plain white. Additionally, existing text keeps its original color. For example, when I uncomment some commented code, the color is still darkened as if it were still a comment.

I can refresh my buffer via C-x C-v RET or refresh the mode via M-x js2-mode RET, which updates the highlighting, but this is annoying. Any suggestions?

Additionally, syntax errors that are shown in the mini buffer do not go away unless I refresh the buffer or mode as well.

After enabling M-x toggle-debug-on-error, here is the output of my *Messages* buffer:

Debug on Error enabled globally
Saving file /home/lucas/class/nodeschool/how-to-npm/web-sockets.js...
Wrote /home/lucas/class/nodeschool/how-to-npm/web-sockets.js
Saving file /home/lucas/class/nodeschool/how-to-npm/web-sockets.js...
Wrote /home/lucas/class/nodeschool/how-to-npm/web-sockets.js
Saving file /home/lucas/class/nodeschool/how-to-npm/web-sockets.js...
Wrote /home/lucas/class/nodeschool/how-to-npm/web-sockets.js

Any suggestions about what might be going wrong?


texts: Multiline regex replace within elisp function

texts:
I would like to write a elisp function that corrects a few formatting issues in my LaTeX code. Precisely, I would like to transform the following text

Some useless text
\begin{equation}
    some math stuff
\end{equation}
Further text.

into

Some useless text
%
\begin{equation}
    some math stuff
\end{equation}
%
Further text.

i.e. I want that equation environments that are not surrounded by comments  get an empty comment line before and after the environment. My idea was to write a small elisp function that replaces all such occurences with some regex. With lots of trial and error I found the following regex that seems to find the \begin{equations} that are not preceeded by % in the line before.

^[[:space:]]*[^%].*\n[[:space:]]*\\\\begin{equation}

I also found the following snippet on the internet to do search an replace:

(defun foo ()
  (interactive)
  (save-excursion
    (beginning-of-buffer)
    (while (re-search-forward "foo\nbar" nil t)
      (replace-match "bar\nfoo" nil nil))))

My guess is the a clever combination of these things will give me my result, but so far all my attempts have failed. Can anybody give me some hints on how I achieve the sought substitution?

Update:

After reading:
Emacs regexp groups in regex-replace I came up with the following:

(defun foo ()
  (interactive)
  (save-excursion
    (beginning-of-buffer)
    (while (re-search-forward "\\(^[[:space:]]*[^%].*\n\\)\\([[:space:]]*\\)\\(\\\\begin{equation}\\)" nil t)
    (replace-match "\\1\\2%\n\\2\\3" nil nil))))

which seems to work for the few test cases that I tried so far. It fails when \begin{equation} terms are nested immediately after each other, but since this is not allowed in LaTeX anyway its not a critical issue.


texts:
When I use ispell, it suggests replacements for misspelled words in a window at the top of the screen. However, it is too small, and I can barely read the words it contains.

How do I increase the size of the "suggestions" window?

I'm using Emacs in GUI mode. Currently, I primarily use it on my work MacBook (Mac OS Mojave) but I believe I've observed similar results in Ubuntu 19.10.


texts:
I read in the Emacs manual online about using insert-sliced-image to create smooth scrolling with inline images.

I would like to use this to override org-toggle-inline-images, so that I can get smooth scrolling with images in org-mode.

Any ideas?


texts: Detection inside general LaTeX (not necessarily Math) commands

texts:
This question is related to how to detect if inside a LaTeX math environment?.

How to do the correct settings in .emacs in such a way that the variable texmathp takes the value t (like in math formulae) when the cursor is at the following commands?

\newpage ;command for creating a new page
\label{blabla}
\cite{blabla}
\ref{blabla}
\footnote{blabla}
\section{blabla}
\chapter{blabla}
\\ ;command for creating a new line

In the answer it was mentioned that one can use texmathp-tex-commands to achieve such things. Let me ask how to do it for the above formulae.


texts:
I'm new to emacs, does anybody know is there a way to combine xml-mode and sql-mode so SQL code inside tags can be highlighted and proper indent?

example

<FnTable ID="MyCode">

  declare @ID bigint = @p0

  select * from Company.Table where ID = @ID

</FnTable>


texts: When I run a command with async-shell-command, sometimes I would like to quickly rerun the command. I can do this by running async-shell-command again and using M-p to cycle backward through history, but I would prefer to just press g in the output buffer (matching Emacs standard refresh semantics). How can I activate this functionality?


texts:
I am a beginner Lisp programmer and new to Emacs. I work on Portacle. I must have done something because when I press C-c C-c to compile a function in a buffer I get: C-c C-c is undefined. This worked until about an hour before. I restarted Portacle a few times but it's the same all the time.
Here is the content of the message buffer:
Loading portacle...
Loading iso-transl...done
ad-handle-definition: ‘er/expand-region’ got redefined
Loading g:/Lisp/Portacle/portacle/config/user.el (source)...done
Loading portacle...done
Starting new Ispell process G:/Lisp/Portacle/portacle/win/bin/hunspell.exe with en_GB dictionary...
For information about GNU Emacs and the GNU system, type C-h C-a.
Polling "c:/Users/frmau/AppData/Local/Temp/slime.12988" .. 1 (Abort with ‘M-x slime-abort-connection’.)
Loading g:/Lisp/Portacle/portacle/config/.frame.el (source)...done
Polling "c:/Users/frmau/AppData/Local/Temp/slime.12988" .. 2 (Abort with ‘M-x slime-abort-connection’.)
Connecting to Swank on port 49981..
Connected. Are we consing yet?
Mark set
File mode specification error: (user-error Unmatched bracket or quote)
mwheel-scroll: Beginning of buffer [3 times]
C-c C-c is undefined
mwheel-scroll: Beginning of buffer [7 times]
C-c C-c is undefined

I work on Windows. I can't do any work until this is resolved.


texts: In what circumstances will edebug produce different behaviour?

texts:
I'm trying to debug this julia-mode indentation issue using edebug.

The elisp I'm running is here and the bug only occurs on Emacs 23.3.

TAB is bound to julia-latexsub-or-indent. I can reproduce the issue. However, if I run edebug-defun on julia-latexsub-or-indent, the problem disappears!

I know Emacs has a lot of internal state, so I presume some of it is modified by edebug (even though it uses a recursive editor).

When is edebug not appropriate for debugging?


texts: Why is dired-find-alternate-file considered confusing?

texts:
Pressing a in a dired buffer gives me a warning:

  [...] disabled command dired-find-alternate-file.

  It is disabled because new users find it confusing.

As far as I can tell, it just opens the file or folder. What is confusing about it? More generally, what criteria does Emacs use for marking commands as confusing?


texts:
In order to compile my lua code i use this config
(defun lua-main-compile ()
    "use lua to compile my lua code"
    (interactive)
    (compile "lua main.lua"))

In my lua code when i type
x = 10
io.write("Enter the name of the variable you want to be printed: ")
index = io.read()
f = loadstring("return " ..  index)
print(f())

when I use this the *compilation* buffer opens and I get Enter the name of the variable you want to be printed: which is good. But I can not input there (as I understand I only type q there). What must I do?


texts: How can I print a full reference using reftex?

texts:
I would like to embedd full references of BibTeX entries in selected sections of my org-mode files or at least have the ability to quickly open the full reference in a new buffer.

How can I do that?

C-c & (reftex-view-crossref) does not work and only opens an empty buffer when using the following configuration for reftex:

(with-eval-after-load 'org
  (defun org-mode-reftex-setup ()
    ;; (load-library "reftex")
    (require 'reftex)
    (and (buffer-file-name)
         (file-exists-p (buffer-file-name))
          (reftex-parse-all)
         )
        (make-local-variable 'reftex-cite-format)
    (setq reftex-cite-format "[[%l]]")
    (setq reftex-default-bibliography '("references"))
    (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
  (add-hook 'org-mode-hook 'org-mode-reftex-setup))

[1] Reftex manual: Viewing cross references


texts:
How to ignore emacs backup (*~) files in projectile?
My code does not work.

(use-package projectile
  :config
  (progn
    (setq projectile-globally-ignored-files
          (append '(
                "*.pyc"
                "*.class"
                "*~"
                )
              projectile-globally-ignored-files))
    (projectile-global-mode)
    (setq projectile-completion-system 'helm)
    (helm-projectile-on)
    (setq projectile-enable-caching t)
    (defconst projectile-mode-line-lighter " P")
    )
  )

When I call helm-projectile-find-other-file I always see backup files which is quite annoying.


texts: How to NOT Auto Indent when a specific Character is inputted?

texts:
So I recently encountered a problem programming in C that whenever I enter the left parenthesis character, (, Emacs auto-idents the code.
[4 spaces here]DATA *SeqQueueOut(

I know that there is this thing called electric-ident-mode, which I do not want to disable it. All I want to do is to not ident the code specifically whenever I type (. How can I do that in init.el?


texts: org-publish gives multiple entry with quote one of them

texts:
So, I have the following content in the .dir-locals.el file for my project:
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((org-mode
  (org-twbs-link-up . "https://psibi.in/prometheus/")
  (org-twbs-link-home . "https://psibi.in/")
  (org-publish-project-alist . '("prometheus"
                                  :base-directory "~/github/prometheus/"
                                  :recursive t
                                  :base-extension "org"
                                  :auto-sitemap t
                                  :publishing-function org-twbs-publish-to-html
                                  :publishing-directory "~/github/prometheus/docs/"))))

Now when I invoke org-publish from a file, it gives me two entries:

quote
prometheus

Now I don't understand what quote is and why it's populated ? What am I doing wrong ? Reproducible repository is here: https://github.com/psibi/prometheus


texts: Treat symbolic-link as separate files while visiting

texts:
Is there a way to make Emacs visit already visited file(with active buffer) via symbolic-link as a different file?
I want them(links/file paths) to be visited by different buffers.
It will be best if this behavior can be controlled with a directory local variable.

Why I need it:

I have a bunch of source files under actual project root source directory with a project file (it configures build tools) for production builds.
But I also have those files under a different root (for development environment)
The whole thing resides in the same git repo and has .dir-locals.el with:

((nil . ((find-file-visit-truename . nil)
         (vc-follow-symlinks       . nil))))

It works fine (despite obvious problems with version control).
The only thing that is really inconvenient is that I sometimes visit source files via production root paths and then Emacs always opens them via the paths and it messes up with development tools/Emacs integration. So I have to kill the buffer and re-visit files under develop.


texts: Patching together emacs buffers and shells outside of emacs

texts:
I'd like to use emacs as a replacement for my current IDE when using R. I like to divide my workspace into three panes:

Text editor
R console
zsh

Previously, I had used tmux to achieve this by patching together these three parts (i.e., three shells running emacs as my editor, an R console, and zsh itself). Nevertheless, I discovered in an earlier question that it makes more sense for my R console to be running within emacs so that the editor and console can interact easily (via ESS-mode). For simplicity in structuring these three panes, I could run zsh within emacs, too, but I personally don't like shell-mode and prefer to use a regular zsh outside of emacs. (Apologies if this is sacrilege around these parts.)
Q: Is there a way that I can structure these three panels, as shown below, where the dashed line indicates buffers within emacs?


texts: Highlight matching parenthesis, only in Lisp mode (and maybe a few similar modes)

texts:
is there a way to have the global minor mode show-paren-mode
functionality as a buffer-local minor mode? I love its behavior but only for Lisp.

Searching for a package I can see a number of close tries but no bullseye.
I do not want the "electric" behavior of automatically inserting the
matching delimiter; I just want to be visually reminded of the mate of
the delimiter under point.  The closest seems to be the GNU package
flylisp, but it's from .. 2014 ?


texts: Multiple async-shell-command commands in sequence

texts:
What is the correct way to run multiple async-shell-command invocations serially?

For example, this will execute all at once.

(progn
  (async-shell-command "echo 1; sleep 1")
  (async-shell-command "echo 2; sleep 1")
  (async-shell-command "echo 3; sleep 1"))

But I want each command to wait for the command before it to finish first. (Of course in this case you can just chain them together with bash and &&, but you might like to have different output buffers, etc.) And I don't want to make the user wait, which is why I don't use UI-blocking shell-command function.

The only way I've figured out how to do this is with sentinels and continuation passing, which is very ugly.


texts: Decomposing helm-source-buffers-list in two parts

texts:
I'd like to customize helm-mini in such a way that its helm-source-buffers-list would be decomposed in two parts:

One source corresponding to buffers visiting a file (i.e. something like (remove-if-not #'buffer-file-name (buffer-list))
Another corresponding to the complement of (1) (i.e. (remove-if #'buffer-file-name (buffer-list))

I looked at tutorials like this one which gives me an idea of how I could probably do it:

http://kitchingroup.cheme.cmu.edu/blog/2015/01/24/Anatomy-of-a-helm-source/

but I'm too new to Helm to imagine that whatever solution I will come up with will make complete sense or be minimal enough.. so I'd appreciate any help.


texts: how to add double quotes in strings with single quotes using electric-pair-mode

texts:
if i write a double quote in a string with single quotes, i want electric-pair-mode to write another double quote. Example:
<?php
    class test {
        public function test2() {

            $q = " where val = 'radio' ";

        }
    }
?>

my goal is to write the following:
            $q = " where ".$r." and val = 'radio' ";

after i write the first double quote after 'where', electric-pair-mode should automatically insert a second double quote. namely like this:
            $q = " where "" and val = 'radio' ";

but this does not work. what i have to do to make electric-pair-mode work the way i want.


texts:
When the magit-commit-popup window opens, there are one or two lines that are just below the screen. Calling fit-window-to-buffer in the popup buffer fixes the problem, but I would like to automate the process.

However, none of the following seems to work:

(add-hook 'magit-popup-mode-hook #'fit-window-to-buffer)
(add-hook 'magit-create-buffer-hook #'fit-window-to-buffer)
(add-hook 'magit-popup-help-mode-hook #'fit-window-to-buffer)
(add-hook 'magit-refresh-popup-buffer-hook #'fit-window-to-buffer)

Is there some hook that I'm missing?


texts: How to get thing-at-point between separators

texts:
I'm trying to get hold of the current filename at point.
In an arbitrary buffer.

Say I have list of files in a buffer and I want to be able to do something with each file. For that I need to determine filenames

That's easy you may say, just use (thing-at-point 'filename), and you'd be right, unfortunately that thing simply can't detect filenames with spaces in them.

So, here's the output of ls.
I turned whitespace-mode and saw this:

So I've figured - I need to hold onto the thing at point that separated by double whitespace at both ends.
Or to be precise: start-of-line|end-of-line|double-whitespace

Can someone help me with that? Thanks!

I looked into previous-property-change and buffer-substring-no-properties, but couldn't figure out how to apply for my thing, re-search-forward & re-search-backward is probably what I need to use, but I can't figure out the correct regex. Damn, regexes in elisp are wild and untamable.

update: Attempting this:

(defun get-filename ()
  (interactive)
  (save-excursion
    (let* ((start (re-search-backward "\s\s\\|^"))
           (end (re-search-forward "\s\s\\|$")))
      (buffer-substring-no-properties start end))))

and it's not working ;(

update 2: This worked:

(defun get-filename ()
  (interactive)
  (let ((start (save-excursion (re-search-backward "\s\s\\|^")))
        (end (save-excursion (re-search-forward "\s\s\\|$"))))
    (string-trim
    (buffer-substring-no-properties start end))))


texts: Open a wildcard-link directly rather than through dired

texts:
In Org mode, when I open a link (C-c C-o) to a file such as file:something.pdf, the file is opened with my system PDF viewer. However, if the link contains a wildcard, such as file:3_o*.pdf, Emacs opens it through dired instead (also mentioned in https://emacs.stackexchange.com/a/51365), and selecting the pdf opens it within Emacs.
I would instead have it open the first match of that pattern in the system application - and don't highlight it in red. I'd also be fine with a custom link type if this can't be done otherwise.


texts: How to keep a high-level window configuration?

texts:
I use Emacs as a single maximized frame. The monitor is wide enough for two windows to sit together there, with a vertical split. I want this window configuration to be permanent, i.e.:

I want it to be impossible to delete either of the two child windows (except for by my explicit request or something) and
I want it to be impossible to split the root window (i.e., add another child, in addition to the existing 2).

IOW, I want it to be impossible to change (add or remove) children of the root window.

How do I do that?


texts: Can connect TRAMP with m-x ssh but can't with anything else (org code blocks, C-x C-f, etc.)

texts:
I have a very strange issue. I have no idea how to debug. TRAMP hangs every time I issue it via C-x C-f (and choose ssh), when I try to execute a org code block:

 :tangle:   /zeltak@aaa.zzz.yyy.xxx:/home/zeltak/.i3/config :mkdirp yes

but when I try to launch it with M-x ssh it does prompt me for a passwords and connects fine.

Any clue what can be going on?


texts:
How can I make Emacs break on an error, even if the error is being handled somewhere?

In my current scenario, the setup of a major mode is modifying the buffer and I want to find out why (and then fix it). I made a buffer read-only, ran edebug-defun on the major mode function and set debug-on-error to t, but running the major mode function still proceeds until it aborts with a “Buffer is read-only” error. How do I get it to break on error, so that I know where it is raised and can examine the environment? Or at the very least how do I get a backtrace?


texts: How to add-to-list to read-in file contents

texts:
When I do this (setq v (f-read-text "s.el")) where s.el is of this form

((thing1 . thing2) (thing3 . thing4))

I get v back as one long string. And (setq v (append (f-read-text "s.el"))) doesn't seem to change things to a list. I want to do a push or add-to-list an item, but I seem to be adding that item to a list containing a big string. I'd like to return the contents of s.el as a list and then do the push or add-to-list. Then I need to write it back out, again not as a string.


texts: AucTex with periodic compilation and DocView

texts:
Fairly new to Emacs.
I am trying to set up periodic compilation of LaTeX document so that I don't have to manually compile it. I figured I needed to use the function TeX-command-run-all, and since it seems to have interactive in the code, I have to call-interactively.
This is what I tried:
(defun periodic-compile()
  (run-with-idle-timer 5 1 (function (lambda ()
                 (interactive)
                 (call-interactively 'TeX-command-run-all)
                 ))
               )
  )
(add-hook 'LaTeX-mode-hook 'periodic-compile)

However, I am having several problems with this:

This produces an output like desired only once, but also gives an error Error running timer ‘pdf-cache--prefetch-start’: (wrong-type-argument number-or-marker-p nil)
After that, every time Emacs is idle for 5 seconds, it gives a different error Error running timer: (wrong-type-argument stringp nil).
It doesn't seem to respect file type. If I switch the buffer to something else, which is not a .tex file, and so we are not in the LaTeX-mode, it still continues to run.

I suspect for the first two issues, that I must be sending some wrong arguments somewhere. But I checked the docs, and I cannot find where I am making such an error! For the third one, I suspect that once started, the timer just keeps running regardless of the mode. How do I stop that?
As an aside, I read somewhere that packages such as flycheck/flymake can do what I want more effectively. However, I am not able to understand how to run custom functions from them either. If someone can help me with that, that would be great as well!


texts:
I want to make use of a Thinkpad trackpoint's thumb buttons which I almost never use in Emacs anyway. I'd like to use them as additional Controls in Emacs, and in Emacs only. I've found this answer, where it is pointed out that it may be possible to do just so:

  One obstacle for a full equivalent to Control is that it would need to know both when it was held down and when it was released. Emacs keyboard events (unlike mouse events) don't get split into 'down' and 'up' parts, which makes 'released' hard for us to detect there.

However there were no example given and being an absolute beginner in Emacs Lisp I'm not quite sure what to do with it.


texts: Company-mode always returns No completion found

texts:
I start Emacs, open a python file, try autocompletion (my keybinding is C-c i to call company-complete-mode) and works well.

After run pyvenv-workon RET myvenv to activate my virtual enviroment, company-complete-common always returns No completion found.

company version: 0.94
emacs: 25.3.1 on Arch Linux x86_64

Any suggestions?


texts: How can I have same font and font-size everywhere?

texts:
I'm tired of the weird (seemingly) unpredictable font behavior not just in org-mode but also anywhere I use some unicode symbols. My setup is spacemacs and I'm looking for function that I can run on startup that will make all the text rendering use the same font and font-size... as if running in VTY

EDIT: setup: latest spacemacs + clojure layer with fancify symbols enabled
https://practicalli.github.io/spacemacs/install-spacemacs/fancify-symbols.html
https://imgur.com/a/qLlEi4H

Using font Inconsolata for Powerline

EDIT: proof that the character is included with the font https://i.imgur.com/wq53hcr.png


texts:
I am trying to run my python script with spacemacs + ipython on my remote machine.
I found this and works:
Running ipython remotely

But with this approach, everytimes when I lose connection with remote machine ,the Python Buffer just dead(shows no process in this buffer). Then I have to re-open a python buffer, and re-run what I have run in previous python buffer.
This is kind of wasting time.

Is it possible to preserve Python buffer and automatic reconnect to it when network is reachable?


texts: Turn off mouse highlighting in org-agenda

texts:
When I am viewing my org-agenda, whatever line I have the mouse point on is highlighted. Since I never act on these lines with the mouse, and since the line where point is is also highlighted, the extra highlighting is distracting and confusing.

How can I disable highlighting the line under the mouse tip in org-agenda views? I am sure it is an easy fix, but I can't figure out the name of the relevant variable to customize. Thank you!


texts: What is "Symbol Highlight Transient State"?

texts:
Pressing * (spacemacs/enter-ahs-forward) works like visual star in Vim, except for the mini buffer:

What is "Symbol Highlight Transient State" in the mini buffer about?
Where is the documentation that explains the minibuffer options?:

                                        [r] change range  [R] reset   [e] iedit
                    [d/D] next/previous definition
[KEY] exits state  [KEY] will not exit

I am using Emacs 25.2.1 with Evil Spacemacs and Ivy on Linux.


texts:
is it possible to define key bindings at one place in an init file? something like:

(define-key-bindings
    '(("C-x M-f" 'fly)
      ("C-x M-k" 'run)
       ...))


texts: Error in process sentinel: No error or warning to show

texts: I am receiving the above error when trying to compile a LaTeX document in emacs 24.5, using auctex 11.89.3. Previously, I would get either "Run LaTeX again", or "Compiled successfully". This happened after I updated some packages yesterday, and I am unable to fix it. I did not pay attention to which packages were updated, and I also deleted the obsolete packages immediately, so I do not know what is causing this. Any suggestions?


texts: How to view .docx file from Dired with Cygwin Emacs?

texts:
Existing approaches suggest pandoc+markdown or unoconv+Libreoffice and both results are circuitous.
Is there a way to get something close to how PDF pages are rendered with pdf-tools?  I have tried shell-command+Explorer but that opens a Word instance and forces me out of Emacs.

What is a way to display an MS Word file in a clean way (image slices ok too) similar to Explorer preview or PDF preview all within an Emacs buffer?


texts: Testing if emacs was invoked with a file to visit

texts: I'd like to configure emacs to enable desktop-save-mode at startup, but only if it is not invoked with a file to edit. That is, I want to use desktop-save-mode when I call emacs, but not when I call emacs file.txt. Originally, I considered just testing if command-line-args was empty, but this would also disable desktop-save-mode if I called emacs with flags for some other reasons, e.g. emacs -nw. I could try to write a script to parse the command line arguments myself, but that sounds tedious and error prone, so I'm hoping to avoid that if possible.


texts:
I have been able to install Emacs 25.1 and AUCTeX 11.89.6 (this is the number that I have after installing it with MELPA directly from Emacs) that I am using on a Windows 7 machine.
I am trying to use ispell possibly with flyspell but when I type
M-x flyspell-mode
I get: Error enabling flysepll
(Searching for program No such file or directory ispell)
I have tryied adding
(require 'ispell)
(setq ispell-program-name "ispell")
and
(setq ispell-program-name "tex-ispell")
I have read that ispell comes with Emacs 25 and I have found isepll.el in the emacs directory. I have also checked that I have that directory on the Emacs path by
C-h v load-path
Finally, I have tried to "launch" directly from with emacs in the customization menu but failed.
It seems like an easy task but I am not being able to make it work.
Any pointer would be great.
Thank you.


texts: Open an empty, brand new file in a new Emacs window, from terminal

texts:
I work on a Mac 10.9.5 and use Emacs 24.4 (installed with macports).

This question is related to https://stackoverflow.com/questions/27778836/customizing-emacs-open-new-files-tabs-and-properly-storing-back-up-files?noredirect=1#comment43984459_27778836 .There I was advised to split the "whole-question" into different questions, and also post it here, so here is the 1st of 3 emacs related questions, , hopefully in a better format and in a more adequate stack exchange.

open an empty, brand new file in a new Emacs window, from terminal.

at the moment, when I type in my terminal (or XQuartz), for example:

>emacs new.py &
The file ~/new.py does not exist.

which, effectively, does not exist, but I would like Emacs to open an empty file called new.py. Of course, I can always get around by typing:

>emacs &

then start coding and save it as new.py. I simply would like to be able to do that from terminal. Also, once emacs is open, if I type >emacs& on terminal, I "land" in the file already open and I have to do : Cmd-N + C-x C-f to open a brand new file. So my first question is: Is there something to be added to my .emacs file so I open a brand new file from terminal?


texts: Org-mode latex pdf export command doesn't find citations

texts:
I'm trying to write my thesis in org-mode, and so far it feels amazing. The integration with my todo system, the easy markup language, integration with latex. Wow.

But recently (since I upgraded to the latest latex version on my Arch system, and installed biber from the separate package) the export to pdf cannot find my references anymore.

If I export to .tex first and then run latexmk -f -pdf minimal.tex from the command line everything does work correctly.
Here are the relevant settings in my init file:

(setq org-latex-pdf-process
      (list "latexmk -f -pdf %f"))

Because it uses so many files, I made a small git repo with all the files.

minimal.org is the source file. note that some of the lines start with # +, and are thus comments.
minimal.bib is a tiny bibliography file.
minimal.tex is the auto-generated .tex file.
fromlatexmk.pdf is the pdf file generated from the command line with the .tex file as input.
fromorgmode.pdf is the pdf generated from org's C-c C-e l p (or o), with the failed references.

I hope somebody can help me solve this mystery!


texts:
Sometimes I want parts of the text within an org buffer to be 'masked' by default. The reason is that I may want to look at that file with someone looking over my shoulder, where they should be able to see most of what's there, but some information I'd rather they not, a name for example.

One way I've discovered to do this is to use a faux link. So this:

  On Jan. 30, Mary Smith contacted me with concerns about the project's budget.

is entered as this:

  On Jan. 30, [[Mary Smith][**********]] contacted me with concerns about the project's budget.

and displays like this:

  On Jan. 30, ********** contacted me with concerns about the project's budget.

There's an added benefit that hovering over the 'link' shows the hidden text. It's a little kludgy, but it meets my needs. Obviously isn't for information that requires a high degree of security, and that's not what I'm after.

My question is whether there is maybe a better way to go about this. A better solution should make it easy to format text so that it's hidden AND to access the original, hidden text.


texts:
Windows 10, Emacs 25, Helm

How copy content of minibuffer to kill-ring?


texts:
I want to access contents of emacs buffers from outside like in acme editor.

  Acme is in part a file server that exports device-like files that may be manipulated to access and control the contents of its windows.

And no I don't want plugin that makes emac behave like acme etc. I just want to be able to access and control the contents of buffers.

How can I do that? Is it possible?


texts:
When I start emacs and press C-x g, it says: "C-x g is undefined". I can open a file belonging to the repository, and it still doesn't work. I need to start it manually (?) (C-x magit-status). And it's only after that that the keybinding starts working. But it still doesn't work in the *GNU Emacs* buffer, and in Dired. What's the supposed workflow? Should I add something to the config?
My current ~/.emacs:
(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.
 '(package-selected-packages (quote (magit))))
(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: Visual-line-mode not working in spacemacs

texts:
I've seen a lot of questions relating to visual-line-mode not working in specific modes, e.g., org mode, but I can't get it to work in spacemacs in text mode. The relevant part of my .spacmacs file:

  (add-hook 'text-mode-hook 'turn-on-visual-line-mode)
  (add-hook 'text-mode-hook 'spacemacs/toggle-visual-line-navigation-on)

The second line is something I found somewhere (this site, probably) to make the cursor movement more natural, but the only line in the configuration file proper that I can find that has something to do with visual line mode is this

   dotspacemacs-visual-line-move-text nil

and it doesn't look like it actually turns anything on.

I've tried M-x visual-line-mode, which (interestingly) first disables it and then enables it, but no matter what I do, the hard line breaks are inserted.

I'd like to use spacemacs for normal writing, but the hard line breaks inserted every 80 chars makes this impossible.


texts: How should I go about adding actionability to common interface elements (like commits)?

texts:
I was on the fence about raising this on GitHub, but it's not necessarily a feature request and it certainly isn't a bug report.

I'd like to add some actionability to every reference to commits within Magit.  For instance, I'd like to add a 'browse this commit on GitHub' feature to Magithub, but I don't want to track down all the places commits are displayed to a user – I'd like to just say 'commit references should have this additional behavior' and have that just work.

Soon, I'll want to do something similar for branches, and I can easily see this list growing.  A one-off solution for commits clearly won't scale well.

Is this possible already in Magit?  If not, how should an implementation approach this?  My guess is that the text should use a local keymap that can be modified by consumers.  (If the latter, I will definitely add this as a feature request on the tracker and link the discussions together.)


texts: In-sync editing the same file in two frames

texts:
For a lecture, I'll have a setup with two frames (one on my notebooks's screen, the other on the projector) showing the same file. When editing the file in the "master" frame I need the "slave" frame to be exactly in sync: both shall show the same position in the file, both shall scroll in sync. If I move the point in the "master" frame it shall move in the "slave" frame accordingly. In short, the "slave" has to be a clone of the "master".

Any ideas?