texts: Launching GUI emacslient destroys terminal frame resizing capabilities

texts:
Whenever I launch a GUI session as $ emacsclient -c  all the emacsclient sessions I've created with $ emacsclient -nw -c lose several settings. The problem only occurs right after launching a GUI session, so everything is fine when working soley from the terminal or when avoiding the use of emacsclient.

Now, I've already found out that you can fix some of these issues by adding to the after-make-frame-functions hook. However, one issue persist because it seems to be out of emacs control. Namely, whenever a terminal frame is resized (this happens frequently due to me using a tiling wm) it's doesn't properly refresh it's contents. This can be partly fixed by adding a call to redraw-display (or possibly redraw-frame) to the after-make-frame-functions hook, as this will tell all the existing emacs frames to update whenever a new one is made.

There is a catch to this unfortunately: redraw-display obviously won't get called when opening up a new window that is not emacs, say a browser window. Therefore, all my emacs sessions will eventually become all garbled up until I refresh them all manually. Does anyone know how you can tell GUI sessions not to change any/my terminal sessions, or leave alone the frame refreshing? Or should I maybe change something else, like the way emacslient spawns instances? Can I seperate my GUI and terminal sessions completely maybe?

I'm running macOS 10.3.3 and emacsclient/emacs version 25.3.1. I manage my emacs daemon with brew services, if that is of relevance. My GUI emacs is plain Cocoa emacs installed from brew.


texts:
On Emacs, if I type C-h, b a list of keybinds come up, including:

what is A- and how do I access it?


texts: Confused regarding .dir-locals.el and projectile

texts:
I have a python project, it has tests and I can execute them from the command line. I just read about .dir-locals.el in the projectile documentation and I want to execute tests from inside emacs using projectile.
So I create a .dir-locals.el file like:
((nil .
      (
       (projectile-project-test-cmd . "pytest --color=no")
       )))

The variable is set, but when do C-c p P (or M-x projectile-test-project) It asks for the command with Test command: (If I type there pytest --color=no, it will execute perfectly)
The documentation says that it is possible  to avoid the question setting the variable compilation-read-command to no nil.
((nil .
      ((compilation-read-command . nil)
       (projectile-project-test-cmd . "pytest --color=no")
       )))

But if I do that, C-c p P stops asking, but it doesn't execute the tests, it executes a Compilation (!)
This is the result:
-*- mode: compilation; default-directory: "~/tmp/tsp/" -*-
Compilation started at Sat Oct 31 02:05:42

Compilation finished at Sat Oct 31 02:05:42

Would you mind to point me what I am doing wrong?


texts:
Q: how do I change the face of the outline ellipsis?

When working with outlines, the (customizable) ellipsis indicates when a section is folded and there is hidden text, eg:

* A heading...
** A subheading...
*** A subsubheading...

The ellipsis is customizable via the selective-display slot of the display-table, eg:

(set-display-table-slot standard-display-table
                        'selective-display
                        (string-to-vector "!!!"))

Which gets us to:

* A heading!!!
** A subheading!!!
*** A subsubheading!!!

(No, I'm not actually using exclamation points, it's just an example.)

However, what I'd like to do is customize the ellipsis so that it takes the same face as the outline header it is on.  How would one do that?

PS: Note that the EmacsWiki outline-mode node has a couple of suggestions for setting the face, but neither seem to work (at least for me).

PPS: A related thread on the org-ellipsis does not explicitly handle the faces issue.


texts: Can I trust https://launchpad.net/~kelleyk/+archive/ubuntu/emacs?

texts:
Linux Mint 20
Emacs 26.3
I want to install Emacs 27.
I found this site with stable Emacs version.
https://launchpad.net/~kelleyk/+archive/ubuntu/emacs
The question is, can I try trust to this site to download Emacs 27?


texts: How to change "tramp-default-remote-shell" (or any of its descendants)

texts:
Whenever I use the /ssh: directive and later open a shell (M-x shell) while still looking at the remote file/directory, on the remote end it used to open "/bin/bash" and all I had to do was to remove the current path to that file (point is already conveniently placed).
Fairly recently, however, (possibly with the introduction of v27.1) the suggested shell is "/bin/sh" and I need to additionally change it back manually to "/bin/bash" every time I run it.
While I am the sole user of the computer, I take it that editing "tramp.sh.el.gz" is still not recommended as it may be overwritten by any coming updates.  Is there a way to either change the value for tramp-default-remote-shell or any of its derivatives to use "/bin/bash" by the time Emacs has started (user init.el)?


texts: Compile-run-navigate traceback without term mode

texts:
I have experimented with emacs' various shells (term in combination with compilation-mode in particular), and have had performance problems.  For that reason I still use a separate terminal (e.g. gnome-terminal).

My main use case is to run a test suite (python) and then click through stack frames in tracebacks in the test run output (using compilation-mode) to have emacs visit the corresponding source files.  My current use of gnome-terminal leaves me manually jumping to buffers and lines in the tracebacks.

What is the best way to do that that:

Does not use term, shell, or eterm etc.
Does not noticeably slow down emacs
Is in good emacs taste (perhaps, just as an example: works well with existing python or compile-run-debug support built into emacs)


texts: How to send a string to the SQLi (sql-mode/sql-interactive-mode) buffer after processing?

texts:
How can I send a selected region in the sql-mode buffer to an external shell command and let the result be displayed in the sql-interactive-mode buffer (REPL)?

For example, normally, if I select a region in the sql-mode buffer (e.g. my_table) and hit C-c C-r, the text in the region is sent to the sql-interactive-mode buffer (REPL area) and evaluated as a SQL statement (which will generate an error since my_table isn't a valid statement).

Can I alter this behavior so that, the text is first sent to a unix shell command as input, and then the output of shell command is collected and displayed in the interactive-mode buffer?

The shell command I have in mind is this:

{ read message; psql -c "\\d+ $message"; }

The closest thing I can find is this emacs.SE example

(defun wc-region (beg end)
  "Count words in the active region."
  (interactive "*r")
  (if (region-active-p)
      (shell-command-on-region beg end "wc -w")
    (message "No active region")))

, which sends the select text to the Unix shell that does something (a word count) on it, and shows the result in a buffer called "Shell Command Output".

But I'd like to have it work in a sql-mode buffer, and have the processed result displayed in the sql-interactive-mode buffer (REPL area) instead of a new buffer. Just as if I had sent a SQL statement to the REPL.

I adapted the example above to:

(defun wc-region (beg end)
  "Count words in the active region."
  (interactive "*r")
  (if (region-active-p)
      (shell-command-on-region beg end " { read message; psql -c \"\\d+ $message\"; }  ")
    (message "No active region")))

, which almost works except it's not sending output of the unix command to sql-interactive-mode buffer. Instead, it creates a new buffer for output.

(Ultimately, I want to select a table name in SQL-mode, and display its definition in the sql-interactive-mode buffer by hitting a shortcut key. But I don't know elisp well enough.)

-- Update --

@phils

Thanks a lot for your answer. I have two more very basic questions:

can the shell command be fixed so that it doesn't have to be keyed in? The following command seems to work (with the second version):

{ read s; echo "\\d+ $s"; }

Is there a way to fix command to the above string in a wrapper function or using setq somehow?

After executing the command, the focus is in the sql-mode, how can I automatically switch the focus to the sql-interactive-mode buffer after the command is issued?


texts: Is there a way to use org-mode to render generated code?

texts:
I'm new to org-mode, so I apologize if this is a silly question, but I couldn't find the answer on my own.

I have the following block:

#+BEGIN_SRC sh :exports both :results output verbatim code
sed '/^elts/,$p' -n Heap03.hs
#+END_SRC

The goal is to use a shell script to get a block of Haskell code. Unfortunately (though unsurprisingly) the result is interpreted as shell code.

On the one hand, I'd be interested in any answer that explains how to programmatically get/generate some text and then treat it as code (for the purposes of highlighting) in an arbitrary language; on the other hand, I'm wondering if there's some additional parameter I can pass to the begin_src block to control the language of the rendered code separately from the language of the executed code.

Thanks.


texts: How to know if user input a string or a number using interactive

texts:
I want to check if a user input a word or a number. And I write the function look like this:

(defun check-input (arg)
  "description"
  (interactive "senter arg: ")
  (setq isnum (string-match "\\'[0-9]+\\'" arg))
  (if isnum
      (message "INPUT is number ")
  (message "INPUT is string ")))

But every time I enter whether the a number of a word, it just show "Input is string". Can you help me where did I go wrong. Thanks you very much


texts: How do I get a compact view html tags in emacs?

texts:
I an emacs newbie and I generally write a lot html code(~800 lines in one file). Now I want to a compact view to the completed tags. An example of this would be:

        <canvas id="chart-area3">
        </canvas>

Bachelor of Science

This code appears like this:

[+]
...

Well not exactly same but you get the idea. How can I achieve this?
Please also give some details of the key-bindings associated as well/


texts: Region face foreground color as function of original faces

texts: I know you can set the :foreground of the region face so that it simply uses the :foreground of whatever is selected, while using the region's :background. And I know you can just set the foreground and get a single color always. What I'd like is to have the region foreground apply a function on the face it's selecting to decide on a foreground color, so I could do something like change the color for some faces but leave others the same, or lighten/darken all colors. I'm pretty sure this isn't possible within the standard face system, but if it is I'd love to hear it, and if not any pointers to a solution would be great.


texts: column-marker skips blank lines; how to fix?

texts:
I installed column-marker.el. I like the highlighting style better than fci-mode. Unfortunately, column-marker does not highlight bits of the window where the actual line is not 80 chars or more (or whatever its set to). Can this be fixed, so that there's a continuous highlighted strip at column 80? I saw that this issue used to exist in fci-mode, but was fixed. I didn't investigate carefully.

I suppose it's possible to configure fci-mode to display like column-marker, but I haven't investigated this carefully either.


texts: Define a new key binding for font (Auctex)

texts: I want to create a key binding like C-c C-f C-c to get \mathscr{} inside math environment. This is because there is no default key binding for getting \mathscr. How to do this? Remember that C-c C-f C-c is already in use to get  \textsc in the text mode.


texts: Do not open "GNU Emacs" buffer when launching Emacs

texts:
"GNU Emacs" buffer is opened automatically when launching Emacs(both terminal and GUI), and I have to kill that buffer everytime. It's boring.

How to turn "GNU Emacs" buffer off autimatically when launching Emacs.


texts:
As seen below, special words such as functions, types... are rendered with bold font. But the remaining part of the code is not bold. I want to change this behavior.

How can I do this? Any idea?

Thanks in advance...


texts: How to store Tramp passwords permanently

texts:
The cache expiry

(setq password-cache-expiry nil)

works only for the livetime of the emacs client. But I found in the Tramp user manual the possibility to store passwords permanently

  5.12.1 Using an authentication file

  The package auth-source.el, originally developed in No Gnus, offers the possibility to read
  passwords from a file, like FTP does it from ~/.netrc. The default
  authentication file is ~/.authinfo.gpg, this can be changed via the
  variable auth-sources.   A typical entry in the authentication file
  would be

machine melancholia port scp login daniel password geheim

How do I setup this permanent password storage?


texts: Search line that contains n strings, in any order

texts: I want to search for a combination of two or more strings, in any order. I use org-mode.


texts: spacemacs search and replace - rebind keys to emulate classic emacs

texts: I started using Spacemacs on a Mac recently and to my horror discovered the M-% doesn't bind to query replace, but takes a screenshot instead.  How can I reconfigure Spacemacs to behave like classical Emacs?


texts: Howto to change color of cursor and highlighted window in spacemacs

texts:
In particular, I have a blue cursor (and highlighted window), which seems to correspond with spacemacs' Emacs mode.

But I'd like to put that color to yellow or something else. Don't see that in the "Color themes" section of Spacemacs' guide. And I don't seem to have a cursor-color variable, as described here.

How can we tweak the cursor and highlighted window color, without changing modes?


texts:
I've found the rather useful How Packages work in Emacs 24, however, I'd like a definitive answer from an experienced user or a core developer as to which of these is actually preferred in the typical case on 24.4.

Afaik, (add-hook 'after-init-hook ...) is the so-to-say brute-force approach to setting up customizations for packages. However, eval-after-load and its more syntactically sugary with-eval-after-load seem more appropriate for more dynamic and fine grained configuration that plays well with the gradual, separate and lazy loading of extensions.

Is my understand correct? What else should I keep in mind?


texts:
In order to include Common Lisp compatibility I've seen both

(require 'cl)

and

(require 'cl-lib)

Which is correct? As I understand the cl-lib is the later of the two, but is it safe to use just it?


texts: How can I add "side-notes" to a text file in org mode?

texts:
I wonder how could I add the equivalent of side-notes (cues, thinking points indications, references) to a text in org mode?

Tags work fine, but they seem to be limited to headlines.

I could also divide the whole text in two fixed-size columns, (with a |<140>|<20>| table). However, in this last case, the text would not flow adequately.

Footnotes also are a way of adding extra information, but they won't be side-notes anymore. That's why they call them footnotes, I suppose.

What other options do I have? Could I for example open two buffers and somehow "tie" the scrolling of both so that line n of buffer a, always appears at the side of line n of buffer b?


texts: How to write a complex function for binding on a global hotkey?

texts: I would like to set a global hotkey in Emacs to perform a org-clock-in for a defined task in a defined file. This means that I have to open the file ~/org/main.org, then go to the beginning of the buffer, then find the first occurrence of "Some Task", then go to the beginning of the line and running org-clock-in and then save the file. At the same time I must remain in the current buffer at the cursor position. How can I do this?


texts: How to make occur mode select the window of buffer `*Occur*`?

texts:
Is it possible to make the occur mode grab the cursor (point)?, right now when I do M-x occur and search anything in a buffer, it will open the new buffer with the findings but the cursor stays in the buffer instead going to the findings.

I have to do C-x 0 to go to the other buffer every time I do a search.

I tried doing it with a blank init.el just in case is helm or some other package, but I haven't been able to make it focus the cursor on the new buffer.

(I know that there's the helm-occur that does that, but is it possible with any command or function to make the cursor change to the active buffer when that command opens a new buffer? )


texts: search keys and replace by values in another file?

texts:
I have a dictionary key-values dict.tsv file like this:

key1 value1
key2 value2
key3 value3

And my text.txt file has this:

blah blah asdf saf key2 asd blah key1
blah key1
blah key2
blah key3

How do I get this:

blah blah asdf saf key2/value2 asd blah key1/vaue1
blah key1/value1
blah key2/value2
blah key3/value3

I imagine a function working like this:

lookup-and-replace-with-an-association-list works like this

M-x lookup-and-replace-with-an-association-list RET
Input path to dict.tsv and use the whole file content for lookup and replace. Or if no file provided, select the content from current highlighted region.
(internally) Parse the content to a association list dict.list
Input key regex pattern. If no pattern given, take all the keys in the dict.list.
Input replace pattern with value. In my case: keyX/valueX.
Optional, maybe a interactive confirmation yes, no or do-all would be nice.


texts: Config easy template src code in 0rg 9.2

texts:
I read org mode - Easy Templates in Org 9.2 - Emacs Stack Exchange, which instruct to get back org 9.1

  by adding (require 'org-tempo) to your init file or by adding
  org-tempo to the list org-modules. You can do that by customizing
  org-modules.

However, it is nothing of usage,

I can only read the old-fashion style, but cannot change it.


texts: Turn off automatic backups for specific files

texts:
For a long time I've had Emacs put backups for all files into a single folder:

(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))

I hardly ever visit the backups directory, but recently I noticed that it contains a lot of *-autoloads.el files that I don't need backups for. How can I tell Emacs not to make backups of these types of files?


texts: How to remove the duplicate words in Emacs?

texts:
One can find here various ways to remove all duplicate lines in Emacs by preserving the first occurrence. Also Emacs 24.4 introduces the command delete-duplicate-lines.

I am wondering if there is a similar way to to delete all duplicate words by preserving the first occurrence of each words.


texts: Getting maxima source block to return and display latex equations

texts:
I'd like my maxima source blocks to return either valid latex that I can display in the org-buffer, or an image of the results (a la imaxima). Ideally, the pure latex solution would be best.

Here is an example which I'd like to work.

#+BEGIN_SRC maxima :results output raw
C: matrix([1, -1], [1, 1]);
V: matrix([\sigma[11], \sigma[12]], [\sigma[12], \sigma[22]]);
tex(C . V . transpose(C));
#+END_SRC

#+RESULTS:
$$\pmatrix{\sigma_{22}-2\,\sigma_{12}+\sigma_{11}&\sigma_{11}-\sigma
 _{22}\cr \sigma_{11}-\sigma_{22}&\sigma_{22}+2\,\sigma_{12}+\sigma_{
 11}\cr }$$

The result doesn't render in my buffer.


texts: Changed indentation settings - how to reformat old code?

texts:
I changed my Emacs configuration including indentation settings -now when I open an old C++ file I can write code and it looks like this:

int x(int z){
    return z;
}

However, the old code in this file looks like this:

int x(int z){
        return z;
}

In other words its indentation is doubled. How can I reformat the old code so that it's appropriately indented?


texts: Tramp using su fails with powerline prompt

texts:
I'm having a weird problem opening files as root. From emacs -Q, I issue (require 'tramp), customize tramp-verbose to 10, and try to open a file as root: C-x C-f /su::/etc/fstab. I'm then prompted for my root password. Entering the password, Emacs pauses for ca. 10 seconds, then appears to open a new file called fstab, but it's not the fstab that already exists in /etc/fstab. The message about calling make-directory to create the parent directories shows up, so I've apparently opened a new file somewhere. I can't see where, exactly, as C-x C-f, or even M-x shell-commmand pwd both prompt me for the root password, and then fail.

Despite having turned tramp-verbose to the maximum value, there's not much in my *Messages* buffer after all this:

  Creating customization setup...done
  Tramp: Opening connection for root@onottra672626p using su...
  Tramp: Sending command ‘exec su - root’
  Tramp: Waiting for prompts from remote shell...
  Tramp: Sending Password
  Tramp: Waiting for prompts from remote shell...failed
  Tramp: Opening connection for root@onottra672626p using su...failed
  Use M-x make-directory RET RET to create the directory and its parents

  Tramp: Checking ‘vc-registered’ for /su:root@onottra672626p:  /etc/fstab...failed
  Use M-x make-directory RET RET to create the directory and its parents
  Tramp: Opening connection for root@ using su...
  Tramp: Sending command ‘exec su - root’
  Tramp: Waiting for prompts from remote shell...
  Tramp: Sending Password
  Tramp: Waiting for prompts from remote shell...failed
  Tramp: Opening connection for root@onottra672626p using su...failed
  Quit

This is all on a laptop, I'm not trying to connect to another machine.

Emacs 25.1.91.1, and confirmed again with Emacs 25.2.1.

Any suggestions for further troubleshooting, or is this just a regular bug?

Update

The problem was due to my use of the powerline prompt. The debug-log contained the lines:

08:34:24.189824 tramp-accept-process-output (10) # *tramp/su root@....* run *tramp/su root@....*

[30;41m~ [0;31m [m

The  symbol is provided by powerline. Tramp needs to detect shell prompts, and this unexpected character was confusing it. The fix required modifying the variable tramp-shell-prompt-pattern to include the new symbol:

Original value was:
"\(?:^\|
\)[^]#$%>\n]*#?[]#$%>] \(\[[0-9;][a-zA-Z] \)"

New new, corrected value is
"\(?:^\|
\)[^]#$%>\n]*#?[]#$%>] \(\[[0-9;][a-zA-Z] \)"


texts: Emacs Is Auto-Escaping Periods From The Command Line

texts:
I'm attempting to run the profile-dotemacs.el script from the command line using Powershell on Windows. Here's what I'm trying to run

 emacs -Q -l C:\users\tom\Downloads\profile-dotemacs.el --eval "(setq profile-dotemacs-file `"~/.emacs.d/emacs-init.el`")" -f profile-dotemacs

I'm using the backtick mark to escape the quotation marks, which is the standard in Powershell.

When Emacs starts up I get the following error:

eval: Symbol’s value as variable is void: ~/\.emacs\.d/emacs-init\.el

I don't believe this is a Powershell issue because I'm getting the same issue when I try to run the command from the Windows cmd prompt (i.e. not using Powershell).

For some reason Emacs seems to be auto-escaping my periods. Is there some way to fix this?


texts:
I maintain a fork of an org-mode backend for a markdown based
publishing format
https://github.com/fommil/dotfiles/blob/master/.emacs.d/lisp/ox-leanpub.el

Which works great for the org-mode that ships with emacs 25.2.

However, when I use the latest org-mode from the snapshots on even the
most simple of files, e.g. the one line

Wibble wibble I'm a fish

I get a stacktrace like this (huge amount of data elided)

Debugger entered--Lisp error: (wrong-type-argument sequencep :back-end)
  mapc(#[
  mapc(#[
  org-element-map(
  org-export--footnote-reference-map(
  org-export-collect-footnote-definitions(
  org-leanpub-inner-template(
  org-export-as(leanpub nil nil nil nil)
  org-export-to-buffer(leanpub "*Org LEANPUB Export*" nil nil nil nil
nil (lambda nil (text-mode)))
  org-leanpub-export-as-markdown()
  funcall-interactively(org-leanpub-export-as-markdown)
  call-interactively(org-leanpub-export-as-markdown record nil)
  command-execute(org-leanpub-export-as-markdown record)
  execute-extended-command(nil "org-leanpub-export-as-markdown" nil)
  funcall-interactively(execute-extended-command nil
"org-leanpub-export-as-markdown" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

From reading http://orgmode.org/Changes.html#org1e55804 I can see that
I am supposed to remove the :export-block, which I have done locally.

Can anybody see what else I need to change to be compatible with the
latest version?


texts: Where to report problem with file-name resolution/completion for cygwin emacs

texts:
I use emacs -Q for reconstruction of the following problem and the output of emacs-version is
GNU Emacs 25.1.1 (x86_64-unknown-cygwin, GTK+ Version 3.18.9) of 2016-09-17.

If one tries to complete file-names of files in the root directory "/", e.g. by M-:

(file-name-all-completions "cyg" "/"),

one obtains the error (file-error "Reading directory" "No such file or directory" "/").

I would very much appreciate if someone with a working copy of the last git-version of cygwin-emacs could try to reconstruct this problem and report here whether it is fixed in that version of emacs.

Where can I report this problem?
Should I report it directly to http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs or rather to https://cygwin.com/ml/cygwin/?

I am asking because file-name-all-completions is actually a built-in c-function.

My current clumsy workaround is:

(defvar cygwin-root "/cygdrive/c/cygwin64/"
  "Reference of the root directory within /cygpath/...")

(defun cygwin-handle-root-dir (operation &rest args)
  "Several functions don't work for the root-directory \"/\" in cygwin.
We map this directory here to "
  (cond ((eq operation 'file-name-all-completions)
     ;; second arg is the directory "/"
     (when (string-equal (nth 1 args) "/")
       (setf (nth 1 args) cygwin-root)
       )))
    ;; Handle any operation we don’t know about.
  (let ((inhibit-file-name-handlers
     (cons 'cygwin-handle-root-dir
           (and (eq inhibit-file-name-operation operation)
            inhibit-file-name-handlers)))
    (inhibit-file-name-operation operation))
    (apply operation args)))

(add-to-list 'file-name-handler-alist '("^/$" . cygwin-handle-root-dir))


texts: Commands or shortcuts to put a selected region between parentheses or brackets in auctex

texts:
If some region is selected region, then applying a command (such as the commands which insert an environment) provided by auctex results in putting the region in the corresponding environment.

Is these a similar auctex command which puts the selected region between ( and )?


texts: Calculate current-column including display properties

texts:
I am trying to calculate the width of text within either a buffer or a string after it has been displayed, i.e. after taking into account the width of any display properties, such as embedded images, in the text.

The documentation of current-column and string-width talks about the displayed representation of strings in the current buffer, but neither takes the display property into account:

(require 'org)
(let ((s (propertize " " 'display "123")))
  (with-temp-buffer
    (insert s)
    (current-column))                   ; => 1
  (string-width s)                      ; => 1
  (org-string-width s))                 ; => 3

The problem with org-string-width is that it does not work with complex display properties such as images.

This is the best alternative to current-column I have come up with so far:

(/ (- (car (window-absolute-pixel-position))
      (car (window-absolute-pixel-position (line-beginning-position))))
   (default-font-width))

It approximates the "current window column" by calculating the current X-coordinate as a multiple of the default face font.

Is there a better way to achieve this purpose?

My motivation for this question is the misalignment/truncation of Org agenda tags in the presence of org-agenda-category-icon-alist. For example, with:

(setq org-agenda-category-icon-alist
      '(("travel"
         "/usr/share/icons/Adwaita/scalable/status/airplane-mode-symbolic.svg"
         nil nil :ascent center)))

I get the following truncation in the agenda buffer:

Luckily, this can be hacked around with some advice:

(define-advice org-agenda-align-tags (:around (align &rest args) my-column)
  "Override `current-column' to include display properties."
  (let ((override (lambda ()
                    (/ (- (car (window-absolute-pixel-position))
                          (car (window-absolute-pixel-position
                                (line-beginning-position))))
                       (default-font-width)))))
    (unwind-protect
        (progn (advice-add 'current-column :override override)
               (apply align args))
      (advice-remove 'current-column override))))

which no longer causes truncation:


texts: How to look for all active stamps in Agenda?

texts:
Sometimes I do not use SCHEDULE or DEADLINE, but a simple active date stamp.
With SCHEDULED items, they always show as pending, but not with active date stamps, as they are left behind if you don't mark them as DONE.
How could I retrieve all these "left behind" active stamped tasks?
Thank you.


texts:
I stumbled upon the fact that Emacs on Windows sets the environment variable DISPLAY to w32 (if the variable is not already set). This causes problems for example with OpenSSH.

What is the use case for setting DISPLAY? Something within Emacs or is it meant for external applications only? Is there an example app that behaves differently?

Can I safely delete the environment variable? (I know I can do this with (setenv "DISPLAY")).

Note: I use native Emacs build emacs-27.0.50-snapshot-2019-09-18-x86_64


texts: GraphQL and Styled Components syntax highlighting in web-mode?

texts:
How can I add syntax highlighting for GraphQL and Styled Components in web-mode?
Right now it doesn't work, which makes programming much less convenient, and it's surprisingly difficult to find the answer.


texts: Frame position change using elisp not sticking

texts:
Issue

I am able to change the frame position using set-frame-position. But the moment I use a function which uses read-from-minibuffer, the frame restores its position to where it was set using the mouse.

I am not sure if this is a bug because I have seen this issue probably since emacs 24.3 and am still seeing it in the latest build of emacs from its master branch.

How to replicate this problem?

Here's a test function to help you replicate this problem.

(defun my/alter-frame-pos ()
  (interactive)
  (set-frame-position nil 100 100)) ; pixels x y from upper left

Launch emacs -Q.
Eval the above function in the *scratch* buffer.
Position the frame to any random location using the mouse
M-x my/alter-frame-pos. You should see the frame jump to (100,100) pixel location.
M-x find-file or C-x C-f (this is one of the functions that uses read-from-minibuffer)
The frame will jump back to wherever you set it using the mouse!

So basically my frame altering elisp snippet is useless as I have to use the mouse to make the position stick.

I tried edebug but I couldn't go further as read-from-minibuffer is in C and I can't figure out how mouse based frame dragging sets its position.

Solution attempt 1

I tried using Drew's suggestion but the problem still persists.

(defun my/alter-frame-pos ()
  (interactive)
  (set-frame-parameter nil 'user-position t)
  (set-frame-position nil 100 100)) ; pixels x y from upper left

As of writing this question, I was using emacs 25 built on April 16 2015 on RHEL 5.10, GTK+ version 2.10.4, Gnome 2.16.0.

Questions

Are you able to replicate this issue?

  As Drew reported, this issue is not replicated on Windows. So the problem could be specific to Linux or the flavor of Linux I am using (default Gnome that came with RHEL 5.10).

If so, is there a right way of setting the frame position using elisp?
Should this be filed as a bug report?

  debbugs #20361


texts:
I often run into an issue where I will click in a Emacs frame to make it active and accidentally slide my cursor so that it changes from a click to a drag. This means that some text is highlighted which can change behavior of the next commands I run (I am using evil-mode, so this puts me into visual state, but this is applicable outside of evil mode as well).

I don't want to completely disable the mouse, as I find it quite useful I just want to disable selecting text on a drag operation. I tried the following, but it lead to weird behavior (when the pointer leaving frames it will select text and it will still select one character sometimes).

(define-key evil-motion-state-map [down-mouse-1] 'ignore)

Is there a way to accomplish disabling drag to select (in evil specifically or outside)?


texts:
Windows 10, Emacs 25.1, Magit.

I get this kind of message:

And I can't do any command on Emacs. Always show this message.

Or for those who have difficulties reading such tiny text:

  Error in post-command-hook (magit-auto-revert-mode-check-buffers): (file-error "Spawning child process" "Exec format error")


texts: How files in the etc directory should be accessed?

texts:
When invoking C-h h, emacs opens a HELLO file located in Emacs.app/Contents/Resources/etc directory (under Mac OS X). I looked for myself and there are tons of interesting files (JOKES, PROBLEMS, etc.) but I'm not certain what's the canonical way of accessing those files.

(Not too sure what tag should apply here.)


texts: PHP completion with Company does not work on local variables

texts:
I do have a strange issue when working on PHP files.

I have company-mode installed and it works for function completion but not for local variables.

For others languages such as Ruby or Lisp, everything is fine. But not for PHP.

In the following gif, as you can see, I can complete functions that begins by "str" but not the local variable that begins by "$tot"

And here is my very simplified config used for this example:

;; Requires and internal modes settings
(require 'package)

(ido-mode 1)
(show-paren-mode 1)
(transient-mark-mode 1)

;; Internal vars

(setq debug-on-error t
      case-fold-search t
      kill-whole-line t)

(fset 'yes-or-no-p 'y-or-n-p)

;; Use package

(setq package-enable-at-startup nil
      package-archives '(("melpa" . "http://melpa.org/packages/")
                         ("gnu" . "http://elpa.gnu.org/packages/")
                         ("marmalade" . "http://marmalade-repo.org/packages/")))

(package-initialize)

(when (not package-archive-contents) (package-refresh-contents))
(unless (package-installed-p 'use-package) (package-install 'use-package))
(eval-when-compile (require 'use-package))

;; Package :: completion

(use-package company :ensure t :init (global-company-mode 1))

;; Packages :: web

(use-package php-mode :ensure t)
(use-package php-extras :ensure t)
(use-package rainbow-mode :ensure t)
(use-package web-mode :ensure t)

Do you guys have any idea of what's going on ?

Thanks in advance.

EDIT:

C-h v major-mode gives php-mode
C-h v company-backend gives nil
C-h v company-backends gives:

Its value is (php-extras-company company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
            (company-dabbrev-code company-gtags company-etags company-keywords)
        company-oddmuse company-dabbrev)

Original value was
(company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
          (company-dabbrev-code company-gtags company-etags company-keywords)
      company-oddmuse company-dabbrev)


texts: How to make ansi-term wrap lines instead of adding newline so it can fit the window?

texts:
See the screenshot. I typed one long line in the buffer, didn't hit enter but cursor is already on line 3.

This causes multiple problems, eg. when I copy the output of a command from ansi-term to another buffer then it's copied with these additional newlines.

My expectation is that cursor in the above example would still stay at line 1. How can I make ansi-term work like that?


texts: nhexl-mode shows bytes 80-ff with 6-digit hex 3fff80–3fffff

texts:
When I open a file and activate nhexl-mode, non-ASCII characters are shown as 3fffxx in the hex column instead of xx. This disrupts the alignment.

I observed this on Emacs 23.2 and 24.4 started with emacs -Q. On Emacs 22.2, it works fine.

What's wrong here, and how do I fix it?


texts: How do I find out what libraries I need to require?

texts:
When I write elisp, since I already have a lot of packages required which in turn have required other code, I am able to use a lot of functions without requiring them. When I give the code to someone else though, it sometimes fails and tells them some functions don't exist.

My question is, how can I know in some piece of elisp code what I should be requiring explicitly?

I tried just calling describe-function on every function I used, but there are certain functions for which it doesn't tell me what I need to require. For example:

M-x describe-function cl-concatenate

Gives me:

cl-concatenate is a compiled Lisp function.

(cl-concatenate TYPE SEQUENCE...)

Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.

With no mention that I need to require 'cl.

I even tried with a blank Emacs, but it seems that depending on the OS, you might need an explicit require while on others you don't. So when I try with a blank Emacs it still works for me, but not for everyone else.


texts: I was wondering if one can look-up English words in Emacs from an English dictionary that includes IPA or plays a sound. I am using define-word.el package, which is very good but doesn't have IPA.


texts: List classes, methods, and funcs with helm

texts:
I want a list of functions, classes, and methods, without imports or variables, that matches the ordering in the current file.  Since I use helm-swoop, I would like to be able to do this with helm.  I used to be able to.
However, I just switched to lsp-mode.  Prior to lsp being enabled, helm-imenu works as I would like:

Once lsp is enabled, though, helm-imenu gives modules, classes, methods, fields, and variables ordered by group:

It's not clear to me how to return to the pre-lsp-mode behavior.
In true Wisdom of the Ancients fashion, I found an old Reddit post where a person (FreshCakes) achieved precisely what I want....but didn't post their code.
The code they modified is:
(require 'helm-imenu)

(defun my-helm-imenu-transformer (cands)
  (with-helm-current-buffer
    (save-excursion
      (cl-loop for (func-name . mrkr) in cands
               collect
               (cons (format "Line %4d: %s"
                             (line-number-at-pos mrkr)
                             (progn (goto-char mrkr)
                                    (buffer-substring mrkr (line-end-position))))
                     (cons func-name mrkr))))))

(defvar my-helm-imenu-source  (helm-make-source "Imenu" 'helm-imenu-source
                                :candidate-transformer
                                'my-helm-imenu-transformer))
(defun my-helm-imenu ()
  (interactive)
  (let ((imenu-auto-rescan t)
        (str (thing-at-point 'symbol))
        (helm-execute-action-at-once-if-one
         helm-imenu-execute-action-at-once-if-one))
    (helm :sources 'my-helm-imenu-source
          :preselect str
          :buffer "*helm imenu*")))

I can modify format to calculate the number of spaces between the marker and the beginning of the line so that items are indented properly:
(defun my-helm-imenu-transformer (cands)
(with-helm-current-buffer
    (save-excursion
    (cl-loop for (func-name . mrkr) in cands
        collect
        (cons (format "%s %s"
                (progn (goto-char mrkr)
                    (make-string (- (marker-position mrkr) (line-beginning-position)) ?\s))
                (progn (goto-char mrkr)
                    (buffer-substring mrkr (line-end-position))))
            (cons func-name mrkr))))))

Unfortunately, items are still ordered by group and includes imports and variables.  Changing imenu-sort-functions to imenu--sort-by-position doesn't appear to do anything for the grouping.
How can I return to the pre-lsp-mode behavior?


texts: What is the difference between switch-to-next-buffer and next-buffer?

texts:
To go to the next/prev buffer I use the commands next-buffer / prev-buffer. This works well and is very comfortable.
But there are also two other commands switch-to-next-buffer / switch-to-prev-buffer that do same thing.
What is the difference between them?


texts:
Windows 10, Emacs 26.1
dired+

I want in dired mode find files by names, content

Approach#1 - use external tools. What tools you can suggest?
Approach#2 - use only built-in Emacs function on external lib - What you can suggest?


texts:
I have been attempting to disable a prompt by auctex when pressing C-c C-c to view the document for close to the entire day.  As I am a noob to emacs, I attempted to simply modify the auctex configuration used here.  can anyone give me advice what is causing the view prompt?

In essence, I want to compile the file without any request to view the results.

my block is as such so far:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; latex
; based on:
; https://nasseralkmim.github.io/notes/2016/08/21/my-latex-environment/

(use-package tex-site
  :ensure auctex
  :mode ("\\.tex\\'" . LaTeX-mode)
  :config
  (setq TeX-auto-save t)
  (setq TeX-parse-self t)
  (add-hook 'LaTeX-mode-hook
            (lambda ()
            (setq TeX-PDF-mode FALSE)
              (rainbow-delimiters-mode)
              (company-mode)
              (smartparens-mode)
              (turn-on-reftex)
              (setq reftex-plug-into-AUCTeX t)
              (reftex-isearch-minor-mode)
              (setq TeX-source-correlate-method 'synctex)
              (setq TeX-source-correlate-start-server t)))
)

;; reftex
(use-package reftex
  :ensure t
  :defer t
  :config
  (setq reftex-cite-prompt-optional-args t)); Prompt for empty optional arguments in cite

To clarify what I have attempted, I attempted to apply all answers related to "How to disable doc-view in AUCTex".  I have also attempted to modify each line of the block individually, but I cannot determine what is causing the view prompt.

p.s., I may have applied the answer described here wrong.  After the hook, I had (TeX-command-Show LaTeX).  is this wrong?


texts: File mode specification error: How to find syntax problem: Missing :END: line in org-mode properties?

texts:
When I launch my emacs software (Aquamacs.app) I see a message

File mode specification error: (error ":END: line missing at position 23740")

Unfortunately, I do not know in which file this problem occurs. It must be an org-mode buffer, where I have a drawer like :PROPERTIES: or :LOGBOOK: where I accidentally deleted the corresponding :END: line.

I don't see how to find the corresponding place in my files.

Is there a way to check all open buffers for such inconsistency or get a clearer error message which also specifies the buffer where the problem occurs?


texts: How does forward-list work for "" in c++-mode?

texts:
I am trying to understand how forward-list matches template delimiters <> in c++-mode.

forward-list in lisp.el calls scan-lists with the appropriate arguments. The documentation for scan-lists says

  (scan-lists FROM COUNT DEPTH)

  Scan from character number FROM by COUNT lists. Scan forward if COUNT
  is positive, backward if COUNT is negative. Return the character
  number of the position thus found.

  A "list", in this context, refers to a balanced parenthetical
  grouping, as determined by the syntax table.

Looking at the syntax table in a c++-mode buffer, I don't find an entry of which indicates that < and > match each other. Is my reading of the syntax table incorrect? I am assuming that matching entries look like this:

(       ()  which means: open, matches )
)       )(  which means: close, matches (

To summarize, how does forward-list match the template delimiters < and > in c++-mode?


texts:
I'am using spacemacs and I was reading this 5.2.1 TODO keywords as workflow in the org manual and it says that to set a specific state right way the sequence of keys C-3 C-c C-t can be used.

If I hit the control key and the 3 key at the same time it shows me C-u 3- and I can't seem to figure out how to do it as C-3. It still works though.
Should I just ignore this and remember it's the same or is there a way to type it as C-3?


texts: How can I hide/display LaTeX section just like org-mode does with headlines?

texts:
When editing org files, I find it extremely convenient how you can
hide and display headlines and their content by just hitting TAB on
the headline.

For instance, consider the following buffer

* Headline 1
Some text here.

* Headline 2
Some more text here.

If I place the point on the first *, and hit TAB, I will get the following:

* Headline 1...
* Headline 2
Some more text here.

Is there a way to achieve that with LaTeX sections?
i.e., how can I hide and display the contents of a LaTeX
section/chapter/etc, while keeping the title visible? I'm using AucTeX for LaTeX-mode but I haven't
found anything that seems to fill this role.


texts: How can I use a custom Python linter for a specific project with flycheck?

texts:
I'd like to use twistedchecker when working on the Twisted project.

Twisted has somewhat unusual coding standards that aren't mutually compatible with PEP 8 (e.g. a mandatory three line gap between top-level definitions) so I would like the pylint checkers to be disabled and run only the twistedchecker and pyflakes checkers.

I've tried setting flycheck-python-pylint-executable to "twistedchecker" in my .dir-locals.el file, but that does not seem to change the output. (I have confirmed that it is set correctly).

I suspect that the answer is that I should write my own flycheck checker. There are plenty of examples of how to do this, so that should be OK. What I don't know is:

is there an easier way?
if not, how would I tell flycheck to use the twisted checker for files in ~/src/Twisted/?

I have also posted this question to the Twisted-Python mailing list.


texts:
In tex-mode, the font lock mechanism treats characters between « and » as quoted text. This is fine for French and Norwegian, which use the quotation marks «thus».

But in German and Danish the quotation marks are placed »thus«. How do I get Emacs' font lock mechanism to treat characters between » and « as quoted text, rather than the other way round?

(I'm using emacs 24.5.1.)


texts: gnus-demon wont auto reliably check emails?

texts:
I have found on google these 2 config options:

(gnus-demon-add-handler 'gnus-demon-scan-mail 3 t)
(gnus-demon-add-handler 'gnus-demon-scan-news 2 t)

As far as i know this should auto check and refresh the group view with new mails? yet this rarely work (i say rarely since occasionally it does work for some reason..)

am i doing things wrong? is there any other way to check why this isnt working?


texts: Assigning same value to multiple variables?

texts:
Sometimes I need to set same value to multiple variables.

In Python, I could do

f_loc1 = f_loc2 = "/foo/bar"

But in elisp, I am writing

(setq f_loc1 "/foo/bar" f_loc2 "/foo/bar")

I am wondering if there a way to achieve this using "/foo/bar" only once?


texts: Visual Basic mode doesn't work after update

texts:
I'm on Windows. I updated my emacs to 24.4. Now, when trying to open a file that has its extension mapped to the Visual Basic mode at http://www.emacswiki.org/emacs/visual-basic-mode.el, I get these errors:

file mode specification error (void-variable \\)

Debug stack trace:

Debugger entered--Lisp error: (void-variable \\)
  eval-buffer(#<buffer  *load*> nil "d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el" nil t)  ; Reading at buffer position 69251
  load-with-code-conversion("d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el" "d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el" nil t)
  visual-basic-mode()
  set-auto-mode-0(visual-basic-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(t t)
  find-file-noselect-1(#<buffer file.vbs> "d:/file.vbs" nil nil "d:/file.vbs" nil)
  find-file-noselect("d:/file.vbs" nil nil t)
  find-file("d:/file.vbs" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)


texts: highlight-regexp(s) with looping over an alist

texts:
Although these two expressions seems to be equivalent (both works):

;; 1
(highlight-regexp "foo" "hi-green")

;; 2
(highlight-regexp "foo" 'hi-green)

Only the first one of the following loops works appropriately:

;; 1
(defun my-highlights ()
  (interactive)
  (let* ((ALIST  '(("foo" . "hi-green")
                   ("bar" . "hi-yellow"))))
    (dolist (COUPLE LIST)
      (let* ((REGEXP (car COUPLE))
             (HI_FACE (cdr COUPLE)))
        (highlight-regexp REGEXP HI_FACE)))))

;; 2
(defun my-highlights ()
  (interactive)
  (let* ((ALIST  '(("foo" . 'hi-green)
                   ("bar" . 'hi-yellow))))
    (dolist (COUPLE LIST)
      (let* ((REGEXP (car COUPLE))
             (HI_FACE (cdr COUPLE)))
        (highlight-regexp REGEXP HI_FACE)))))

In the second case the cdr of the cons cell is ignored. Why? (I'd like to use the form ("foo" . face).)


texts: How to stop auto-fill from indenting with spaces when it wraps?

texts:
I just added this to my init.el
(add-hook 'text-mode-hook
  '(lambda () (auto-fill-mode 1) (set-fill-column 100)))

I am getting the desired autofill, but I am getting four spaces on the new line. How do I prevent that?


texts: Opening Gnus messages to the full height of the screen

texts: I recently switched from RMAIL to GNUS. In RMAIL one views email messages in full screen and presses "n" to go to the next message or "p" to go to the previous one. I have also configured Gnus to use "n" and "p" regardless of whether the message is read or not. However, I would like to view my email messages in full screen, rather than having the message occupy only two thirds of the screen. How can I achieve this?


texts: CC mode: make Tab just insert one tab or complete, no auto-indenting

texts:
I am dissatisfied with current behaviour of Emacs in CC Mode. I'm not sure if this applies to other major modes, but that's one I'm currently struggling with. Here are my problems:

When I press tab, instead of inserting just one tab, Emacs either inserts enough space to match last line indentation level.
I also can't insert tab when on empty line.

I believe those are caused by c-indent-line-or-region function,   according to C-h l, but I don't know what I can do with it. Neither of possible values for c-tab-always-indent change this situation.

I found something about tab-to-tab-stop, and using it helped, however, it disabled expanding snippets from yasnippet or <s in org-mode.

My setup consists of Evil-mode, Company-mode, LSP-mode, and following directives in init.el:

(setq-default indent-tabs-mode t)
(setq tab-width 8)
(defvaralias 'c-basic-offset 'tab-width)

(setq-default c-default-style "linux"
              c-basic-offset 8
              c-tab-always-indent nil
              indent-tabs-mode t)

tab-to-tab-stop has something related to expanding in it's source:

  (and abbrev-mode (= (char-syntax (preceding-char)) ?w)
       (expand-abbrev))

but it doesn't help.

I thought I found solution in using tab-to-tab-stop with c-tab-always-indent to 'complete, and it worked, for some time, but after I restarted emacs, it, again, has no effect.

(setq-default c-tab-always-indent 'complete)
...
;; in configuration for evil mode
(define-key evil-insert-state-map (kbd "TAB") 'tab-to-tab-stop)

So is there a way for me to make tabs stupid, i.e. having pressing Tab just insert \t (or N spaces if configured so), while keeping the ability to expand snippets using it?

EDIT:
After disabling tab-to-tab-stop and seeing with C-h l what exactly causes snippets to expand (org-cycle and yas-expand), I'm starting to suspect that there is some kind of function that tries to understand the context and apply specific action, and my evil-state map interferes with it, taking priority or something? Are my guesses wrong?


texts: Can page-down clamp the last line to the bottom of the window?

texts:
When using page-down (internally scroll-up-command), sometimes the window ends up in a state where end end-of-file is at the top of the screen.

Is there a way to page-down, clamping window position so it doesn't end up scrolling past the document end?

The emacs buffer displays something like this:

;;; some-file.el ends here

Note that I'm not asking for a way to prevent the window moving past the document end entirely (although that could be nice), just a way to change the behavior of scroll-up-command


texts:
Slime defines two commands: slime-call-defun and slime-eval-last-expression-in-repl which take the function name of where point is (or whatever) and copy it over to the REPL prompt and position point accordingly.
Is there such a functionality for Sly and how do I use it?
If not, is there some openly available elisp code, which I could use to achieve this?
If there is no such functionality available, which workflow is intended?


texts: Enabling minibuffer pinentry with Emacs 25 and GnuPG 2.1 on Ubuntu Xenial

texts:
I had to do quite some diving and hunting through documentation and forums, so I figured I might as well do a Q&A here for others:

How do I enable GnuPG passphrase prompting in the minibuffer? The Emacs 25.1 changelog says:

  ** pinentry.el allows GnuPG passphrase to be prompted through the
  minibuffer instead of a graphical dialog, depending on whether the gpg
  command is called from Emacs (i.e., INSIDE_EMACS environment variable
  is set).  This feature requires newer versions of GnuPG (2.1.5 or
  later) and Pinentry (0.9.5 or later).  To use this feature, add
  "allow-emacs-pinentry" to "~/.gnupg/gpg-agent.conf" and reload the
  configuration with "gpgconf --reload gpg-agent".

Doing just that, I just get an error message now and not even the graphical passphrase prompt.

This is GNU Emacs 25.2.2 on Lubuntu (Ubuntu Xenial) with GnuPG 2.1.11.


texts: Multiple replacements when query-replacing

texts:
I have a piece of code like this:
def convert(tir_expr: tir.expr.PrimExpr) -> expr.Expr:
    if isinstance(tir_expr, tir.expr.Add):
        return convert_Add(tir_expr)
    elif isinstance(tir_expr, tir.expr.Sub):
        return convert_Sub(tir_expr)

And I have a lot of convert_XXX cases, and I'd like to get the following result, i.e. repeatedly replacing all XXX with some YYY:
def convert(tir_expr: tir.expr.PrimExpr) -> expr.Expr:
    if isinstance(tir_expr, tir.expr.Add):
        return convert_Add(tir_expr)
    elif isinstance(tir_expr, tir.expr.Sub):
        return convert_Sub(tir_expr)
    elif isinstance(tir_expr, tir.expr.Mul):
        return convert_Mul(tir_expr)
    elif isinstance(tir_expr, tir.expr.Div):
        return convert_Div(tir_expr)
    elif isinstance(tir_expr, tir.expr.IntImm):
        return convert_IntImm(tir_expr)
    elif isinstance(tir_expr, tir.expr.FloatImm):
        return convert_FloatImm(tir_expr)
    elif isinstance(tir_expr, tir.expr.StringImm):
        return convert_StringImm(tir_expr)

I don't know how to achieve what I want and how to search an answer for that. Any tips?


texts: Why are custom themes not usually byte-compiled?

texts:
Three pieces of evidence suggest custom themes should not be byte-compiled:

All built-in themes under etc/themes specify no-byte-compile: t.
The function custom-available-themes considers only .el and not .elc files.
The function load-theme is able to load .elc files in custom-theme-load-path, but only does so if there is no corresponding .el file.

The manual nodes (elisp) Custom Themes, (emacs) Custom Themes and (emacs) Creating Custom Themes make no mention of byte-compilation, so why is it not done? Why are functions custom-available-themes and load-path so restrictive? Does byte-compiling custom themes present any issues or disadvantages?


texts: How do I change the font color of mode-line?

texts: How do I change the font color of the mode-line to make it more visible?


texts: Is there a way to refile a table row or a line?

texts: I'm using refile in a table, but it tries to move all the table, not the line I'm in, if refile cannot move a table-row i think a more general way would be to move the line itself, without knowing if is a list-item, table row, or whatever, do you guys know how to set this? Thanks a lot


texts: How to setup emacs tramp to open remote files while local shell is fish? More precisely is how to ask tramp to use bash shell instead of one named  in SHELL environment variable?


texts: Detection of a LaTeX math syntax error at Emacs level

texts:
Assume that I have mistakenly written $\signa$ instead of $\sigma$ in a TeX file.
Considering the fact that all correct math commands are stored in the file latex.el under LaTeX-math-default constants, is it possible that Emacs detect this error?

More precisely is it possible that Emacs detects that \signa does not belong to the list of commands in latex.el under LaTeX-math-default?

Obviously after compiling the tex file, one can discover this error. But my question is about the detection of this error at Emacs level. Also assume that ispell is not at disposal.

Edited: After the comment of Giordano let me make it precise that I am interested in checking the correctness of a single math command not the entire document. Defining a function which detects that \signa does not belong to the list of commands provided by Latex-math-default when the cursor is at \signa would be perfect.


texts: How to retrieve docstrings from functions and variables?

texts:
I'm trying to write a function that will retrieve the docstrings from any sexps in a file that match (def.*).

I'd want to both be able to retrieve any functions/macros, as well as any variables that are defined.  For variables I would want the docstring, while for any functions I would also want the argument lists.


texts: Org-mode: Getting errors when auto-saving after refiling

texts:
I wanted Emacs to automatically save all buffers after I refiled something, so I followed the bottom-most comment from this question and used

(advice-add 'org-refile :after 'org-save-all-org-buffers)

It works great when the only thing I need to do is refile.

However, if I try to org-copy something (which does an org-refile under the hood), or use a custom function which uses org-refile in some way, I get the following error:

Wrong number of arguments: #[nil "ÀÁ!\210ÂÃÄ\"\210ÅÆ!\203^R^@Ç \210ÀÈ!\207"
[message "Saving all Org-mode buffers..." save-some-buffers t
#[nil "ÀÁ!\207" [derived-mode-p org-mode] 2] featurep org-id org-id-locations-save
"Saving all Org-mode buffers... done"]
3 ("c:/Users/wiuah/.emacs.d/elpa/org-plus-contrib-20160801/org.elc" . 620558) nil], 4

Anyone know what's going on?


texts: An ivy function for recently opened files?

texts:
I know that setting ivy-use-virtual-buffers leads to recently opened files being shown in the ivy-switch-buffer completion. However, I don't want this.

What I want is a separate function for opening recent files. When I invoke recentf-open-file, I want the ivy completion for recent files, instead of the clunky recentf menu.

Doom Emacs provides a neat implementation of this, but I can't seem to find a way to do this in vanilla Emacs. Do I have to write my own function for this? This seems redundant considering the fact that ivy already has the mechanism to do this.


texts:
How to specify a list, which's last element is referring to the first element?

By specify I mean, for example, how to write a setq statement with this list.
I have seen this in the documentation, but I can't find it anymore. Here some pointers:

You could loop over the elements of the list forever, but it uses only about as much memory as it has real elements.
Its cdr points to its car.
You could call it a ring list, but I do not mean stuff from the ring package.
It is  something basic.

I do not have a use in mind, it's just for learning and experimenting.


texts: Using quail input-method to insert a string

texts:
The standard way to define an abbreviation using quail is as follows:

(quail-define-rules
("a" ?s ))

Inserting "a" gives "s".

I am wondering if one can insert an arbitrary string using quail, I tried the following but do not work

(quail-define-rules
("a" ?s?o?m?t?h?i?n?g ))

(quail-define-rules
("a" "something" ))

I know there are other methods to achieve this (e.g., abbrev-mode) but I am interested if there is way to do it using quail.

Update If one uses ("a" "something" ), typing a inserts s and ignores omething.


texts: Overwriting files in an emacs dired buffer using move or copy

texts: When copying or moving a file/files in a dired buffer sometimes the file already exists in the location one is moving or copying to. Emacs then prompts the user and asks whether to "overwrite" the existing file or not. One is given these options: y/n/!/q or C-h. However, one cannot tell if there is any difference in size (or date) between the two files, the one already in the directory and the one being copied. This is crucial information, for at times one would like to keep a larger file or a smaller one. Is there a way of displaying this information or not?


texts:
I have a deadline that is some date in the past(such as 12/26/2019) + interval (e.g. 15d). How would I get it in Emacs? In a previous post under the same title I posted an example with interval = the sum of the two subintervals (15d+1m). Someone answered that would have to be a feature request, but was able to do it with only one interval. Actually, that is all I need, but still don't know how to do it. Would someone be so kind as to give a step by step instruction to do it?

Bottom line: how to get '12/26/2019+15d'?


texts: Annoying "error in process filter: Overlapping strings detected"

texts:
When editing python code with elpy, if I type a single or double quote while writing a new line of code (i.e. adding or changing a line in existing code), the UI freezes momentarily, make the bell sound, and the minibuffer shows "error in process filter: Overlapping strings detected".  It's extremely annoying and unhelpful.  What can I do (besides disabling elpy)?
EDIT: Additional details:

disabling elpy-mode makes it stop
doesn't seem to happen with small files (e.g. 62 lines), but does happen with larger files (e.g. 524 lines)
elpy version 1.34.0

EDIT (by NickD): I was able to reproduce this independently. The backtrace I got is:
Debugger entered--Lisp error: (cl-assertion-failed ((>= string-start last-string-end) "Overlapping strings detected (start=%d, last-end=%..." 12628 12629))
  cl--assertion-failed((>= string-start last-string-end) "Overlapping strings detected (start=%d, last-end=%..." (12628 12629) nil)
  python-nav-end-of-statement()
  python-nav-end-of-defun()
  python-info-current-defun()
  #f(compiled-function (info) #<bytecode -0xf329f5f70555bd7>)(nil)
  elpy-promise-resolve([*elpy-promise* #f(compiled-function (info) #<bytecode -0xf329f5f70555bd7>) elpy-rpc--default-error-callback #<buffer models.py> nil] nil)
  elpy-rpc--handle-json(((result) (id . 8)))
  elpy-rpc--filter(#<process  *elpy-rpc [project:/usr/lib/python3.9/site-packages/ environment:/usr]*<1>> "{\"result\": null, \"id\": 8}\n")


texts: Dynamically filter for multiple tags in org agenda

texts:
As far as I can see there are no previous questions on here that address my specific need, despite some being fairly similar.
In the agenda view, I can use org-agenda-filter-by-tag to filter for/against certain tags. However the prompt that appears only allows me to search for one tag at a time, and the org match syntax that would allow me to filter for multiple tags does not seem to be supported in this context (i.e. "work|laptop" is not a valid search term). To be clear, one can accumulate tag filters in this way, but this does not provide the "OR" functionality I'm looking for.
I'm aware that I can use org-tags-view to allow me to perform this type of search as it suports the org match syntax, however I have a custom agenda view set up with org-super-agenda and do not want to lose the groupings I have, nor do I want to set these groupings globally. I really do just want to filter this custom agenda view for multiple tags.
I'm also aware that I can create custom agenda views for each of the search terms I would like to perform, however there are many different combinations of tags I would like to filter for/against, and which combinations I need to filter for cannot always be anticipated, hence the need for this to  be dynamic.
Maybe I'm missing an obvious trick here, I would appreciate any help that can be provided.
Thanks


texts: Customizing the layout of gdb-many-windows

texts:
I really like all of the information that is available to me when I run GUD/GDB with gdb-many-windows, but I would like to be able to move the windows around some.  Specifically I would like to use the following layout

  +-----------------------+------------------+------------+
  |                       |                  |            |
  |        comint         |  input/output    |            |
  |                       |                  |            |
  +-----------------------+------------------+            |
  |                       |                  |            |
  |                       |     locals       |     sr-    |
  |                       |                  |  speedbar  |
  |        source         |                  |            |
  |                       +------------------+            |
  |                       |                  |            |
  |                       |                  |            |
  |                       |      stack       |            |
  |                       |                  |            |
  |                       |                  |            |
  +-----------------------+------------------+------------+

Is there any way that I can customize this so that I always get the same window arrangement every time that I run GDB?


texts: How can I enable a major mode within a helm buffer?

texts: I am trying to get org-mode syntax within a helm buffer. I want the candidates to render using org-mode syntax. How can I do this?


texts: Turning off loading messages in Emacs minibuffer/GUI at startup

texts:
I would like to prevent Emacs from reporting on everyting that is being loaded at startup in the minibuffer. This is because it seems to pause when telling me which files are being loaded that I have specified myself in my init file.

I have byte-compiled the files that I load from my init file, but the minibuffer still gives me the same message and waits for ~3 seconds per loaded file.

I already use many (inhibit startup-* t) style commands in my init file, so that emacs is faster at startup and I don't get the GNU start screen etc., but I cannot find an equivalent for the minibuffer.

I have found mini-buffer-message and minibuffer-massage-timeout, with the option to set how long messages appear for, which sounds great, but I only want this action (i.e. := zero!) for the startup process, I want the messages otherwise.

Something similar to this might be an idea, but it isn't meant for the Emacs GUI, rather terminal use of eLisp, as far as I can understand.


texts: scroll-preserve-screen-position screws up evil-scroll-down (C-d) in evil

texts:
centered-cursor-mode has been extremely sluggish so I found that this setup achieves the same without the slowness:

(setq scroll-preserve-screen-position t
      scroll-conservatively 0
      maximum-scroll-margin 0.5
      scroll-margin 99999)

The only problem is C-d in Evil mode scrolls to the bottom of the screen and not half screen like before. C-u performs as expected (scrolls half screen up).

I checked the key binding of C-d and it still shows up as (evil-scroll-down count) as expected.
Not sure how to fix that.


texts: elpy-goto-definition doesn't work when jedi:goto-definition does work

texts:
After installing a fresh install of emacs on a coworkers machine, I got elpy setup with all the correct packages according to elpy-config but elpy-goto-definition always returns 'No definition found'. Running jedi:goto-definition works as expected, bringing up the expected file and putting the cursor on the definition. I know this is a configuration issue but I cant seem to figure it out despite using my own system as a reference.
Elpy Configuration

Emacs.............: 28.0.50
Elpy..............: 1.35.0
Virtualenv........: None
Interactive Python: ipython3 7.17.0 (/usr/bin/ipython3)
RPC virtualenv....: rpc-venv (/home/user/.emacs.d/elpy/rpc-venv)
 Python...........: python3 3.8.6 (/home/user/.emacs.d/elpy/rpc-venv/bin/python3)
 Jedi.............: 0.18.0
 Rope.............: 0.18.0
 Autopep8.........: 1.5.5
 Yapf.............: 0.30.0
 Black............: 20.8b1
Syntax checker....: flake8 (/home/user/.local/bin/flake8)

and jedi configs
(:emacs-version "28.0.50" :jedi-version "0.3.0")
((:name "sys" :file nil :version "3.8.6 (default, Sep 25 2020, 09:36:53) \n[GCC 10.2.0]")
 (:name "jedi" :file "/home/user/.local/lib/python3.8/site-packages/jedi/__init__.py" :version "0.18.0")
 (:name "epc" :file "/home/user/.emacs.d/.python-environments/default/lib/python3.8/site-packages/epc/__init__.py" :version "0.0.5")
 (:name "sexpdata" :file "/home/user/.emacs.d/.python-environments/default/lib/python3.8/site-packages/sexpdata.py" :version "0.0.3"))

I've also tried running in a venv, but to no avail. Is there a specific venv environment that needs to be run?
Thanks for any help.


texts: How to understand the meaning of "revert"?

texts:
Suppose I open a file in a buffer of Emacs, and then some other program different from Emacs modifies the file. When I try to modify the buffer in Emacs, Emacs will notify me about the change which has occurred to the file outside Emacs. It will give me an option called "revert".

If I understand correctly, "revert" means to reload the file in the file system into the Emacs buffer, so the buffer will be updated with the latest change to the file made outside Emacs.

Literally, "revert" means to undo the last change to something and change the state of something back to its previous state. Then why is reloading a file into Emacs buffer called "revert"?


texts: do not echo commands to comint-mode buffer

texts:
I have a comint managing a subprocess and I want to send a huge text payload to it that the user doesn't need to see (it's a multi-page configuration string that must be provided this way).

Text sent to the comint is normally echoed to the buffer, is there a way to suppress this?


texts: org-refile: leave a link to refiled item

texts:
My workflow: everyday, I capture (using a template) a journal entry that get saved to a datetree journal.org file.

From there I would like to refile to different "project" files but I would like to keep a trace and a link in my journal.org file.
To illustrate; my journal.org would look like this BEFORE the refile:

* 2017
** 2017-11 November
*** 2017-11-13 Monday
**** My entry
***** a heading
****** TODO some task

and like this AFTER the refile:

* 2017
** 2017-11 November
*** 2017-11-13 Monday
**** My entry
***** a heading
****** REFILLED some task
:LOGBOOK:
Refiled on [2017-11-13 Mon] to ~/emacs-tasks.org::*Tasks%20workflow
:END:

What would I do to achieve this? TIA


texts: How to specify the directory for file-exists/delete-file/byte-compile-file?

texts:
I thought it would be great to save a Elisp file (in my init), and it compiles automatically a byte-compile Elisp-file.

So I wrote a function for this.

    (defun remove-elc-and-compile-on-save ()
      "If you're saving an elisp file, likely the .elc is no longer valid. And automatically byte-recompile this file whenever it's saved."
      (interactive)
      (if (file-exists-p (concat buffer-file-name "c"))
          (delete-file (concat buffer-file-name "c"))
        nil)
      (byte-compile-file buffer-file-name)
      )

    (add-hook 'emacs-lisp-mode-hook
              (lambda ()
                (add-hook 'after-save-hook 'remove-elc-and-compile-on-save nil 'make-it-local)))

For example, the directory structure where my Elisp files are: C:\foobar\Emacs\setup-foobar.el. (It's a Windows structure).

It works perfectly. However, my Emacs directory with the Elips-files will be spoiled with the compiled .elc-files all over the place. So I thought to move the .elc-files to a specific directory.

For example, the directory structure where my Elisp files are: C:\foobar\Emacs\setup-foobar.el. (It's a Windows structure).

Then I would like to move the .elc files to C:\foobar\Emacs\setup\setup-foobar.el. When I checked the documentation of the functions file-exists-p, delete-file, byte-compile-file, there is no optional parameter available to specify the path where the delete/compilation operations should occur. They're executed in the same directory as the buffer-file-name.

I tried another ways like:

(byte-compile-file (concat "C:/foobar/Emacs/setup/" buffer-file-name))

But it didn't worked out, and it's not applicable for the file-exists-p and delete-file functions.

So I'm wondering in which way I could specify the path where the operations should be executed, instead in the same directory as the buffer?


texts:
While imenu works very well in most environments, I am having issues when using it in C++ files where functions are not defined flush left.

(Update:)
Steps to reproduce the issue (thanks to Drew's comment below).

Start emacs -Q
Load the file below.
Do M-x imenu
I get the error message: "No items suitable for an index found in this buffer".
If the two functions are not indented (the lines starting with "int"), I instead get the prompt "Index item: ", as expected.

Test file:

namespace this_breaks_imenu
{
   int other_function( int argc, char** argv )
   {
     float b;
     return 0;
   }

  int main( int argc, char** argv )
  {
    float a;
    return 0;
  }
}

If the code is indented like that (with a couple of extra spaces along the left margin), doing S-down-mouse-3 which is bound to (imenu INDEX-ITEM) gives me "No kbd macro has been defined". The same file without the spaces to the left works fine.

Why is this, and is there any way of working around it, other than changing the indentation of the files (which will not be appreciated by my collaborators)?


texts: Import text from docx tables to org-mode

texts:
I got a lots of notes from books in docx. There are in tables ex.:  I would like to convert them to org-mode like this

What would be the best approach to do it ?


texts: Incremental Search on UTF-8 in Julia Mode

texts:
I was wondering if there is any way of searching (incremental search) for a UTF-8 character in julia mode, other than typing the character and copying it into the minibuffer.

I think you can use special input modes to enter unicode characters, but julia-mode is not using the standard tex input mode.  Instead, it defines (kbd "TAB") on julia-mode-map which expands to the entry in the hash table, julia-latexsubs.

Also, I don't want to have to look-up the unicode character in the hash table and enter it manually.

EDIT

I'm going to attempt a brief explanation of Stefan's code.  The tab key is redefined for isearch-mode-map.  First, the binding of newstr creates a temporary buffer and inserts the text from isearch-string.  Then run the julia-latexsub function to see if the previous characters are a hash table entry for a utf-8 character.  If not, newstr will be nil; otherwise, it will now contain the new character.

If newstr is nil, continue on with isearch as normal; otherwise, update isearch-string with newstr.  Then there is some code copied directly from isearch.  I'm not familiar with it, but presumably the purpose is to update what happens in the major mode buffer when the isearch-string has changed.

I also found a way to limit the new behavior to Julia-mode.  The following seems to work.  Insert following newstr.

(if (eq (buffer-local-value 'major-mode (get-buffer (buffer-name)))
        'julia-mode)
    code-to-evaluate)


texts: Org mode how to continue list on previous heading after subheading

texts:
Please see in the image how I expect to put down the information in an org file. Sub-heading 1 has some list items which are collapsed, after which I would like to continue the list at the previous level.

I see how this can be hard to parse as I want it, since the underlying file is just plain text and org-indent-mode is trying to lay it out, but is there a way to capture lists as shown in the image? Can I earmark a particular list item to belong to a higher level heading?

After the state shown in the picture, if I expand and collapse sub-heading 1, 'Third thing' will become a list item under it.


texts: Can't see changes in file on remote Unix machine "on fly"

texts:
Windows 10 (64 bit), Emacs 25.1

in my .emacs I have:

(global-auto-revert-mode t)

So when I open file (in dired mode)  on my LOCAL machine it's success refresh opened file "on fly".
Nice.

Now I want to do same on file on remote machine.
I success connect to remote Unix machine by Tramp mode:

/mylogin@111.222.333.444:

Open file (in dired mode).
But when file change it's not refresh "on fly". I need to close file and reopen again to see changes.

How I can see "on fly" changes in file on remote Unix machine.


texts: Savehistory doubles my startup time, and is not quitting directly

texts:
Emacs startup time on Linux is 2.3 seconds. When I exit Emacs with C-xC-c, it quits instantly.
This changes when I put only the following lines in my configuration:

(setq savehist-file (concat user-emacs-directory "savehist"))
(savehist-mode 1)

Then when starting Emacs, it took 4.5 seconds to start. That's nearly the double of the old startup time.

And when I quit Emacs, it tooks some time. I see only the message
wrote /home/ReneFroger/Dropbox/Emacs/places before it finally quits.

I'm wondering which the savehist feature is consuming so much time? I didn't had this problem earlier.


texts: How to completely clean Spacemacs from the not longer required mode?

texts:
Once I enable a local major-mode.  After some time I decided to remove it.  So I deleted it from disk as well as from configuration (SPC f e d).   But it is still available in my Spacemacs.  At least I see all its functions in M :.

How I can remove it completely ? Is there sort of "compiled cache"?

I'm not even sure that this is just the eval history.  Because I can call these functions/vars and see the result of their work.  As if i didn't remove the major mode at all.  Of course, I restarted my Spacemacs many times (SPC f e R).


texts:
In ViM, there is a :smile command that displays lighthearted ASCII graphics of a figure that smiles.

Is there an equivalent command available in Emacs?


texts: magit status and git lfs files diff shows pointer diff

texts:
When I call magit-status git lfs files are shown as follows.
modified   src/myfile
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-size 4241
+oid sha256:9999999999999999999999999999999999999999999999999999999999999999
+size 4242

Is it possible to tell magit to show me the diff of the contents instead of the lfs-pointers' diff?


texts:
When I execute the function projectile-run-project I'm prompted to enter a run command. Fortunately the run command is already pre-set, because I added projectile-project-run-cmd to .dir-locals.el.

Ideally I would like projectile to immediately run the provided command without prompting me further. From reading the documentation I thought this is possible by providing an argument, so I tried this:

;; insdide use-package
:bind (([f5] .(lambda () (interactive) (projectile-run-project 'projectile-run-project-cmd))))

But when I press F5 now, I just get presented with the same pre-filled prompt again.

Is it possible to just immediately run the project executable?

Bonus question: Can you configure projectile-run-project-cmd inside the .projectile file or something, instead of using .dir-locals.el?


texts: Exporting unicode characters to pdf using latex from org mode

texts:
Hello Good people of Emacs!

I'm having trouble exporting unicode math symbols from buffer (org-mode) to pdf file.

1. Problem Description:

Symbols are inserted to the buffer as unicode characters (via TEX input method or  company-math)

Here is source code demonstration:

#+TITLE: Unicode characters export test
#+AUThor:
#+date:
Unicode characters:

ℝ ℤ ℕ ⇒ ∈ ∀

Same symbols in latex format:

$$\Bbb{R} \Bbb{Z} \Bbb{N} \Rightarrow \in \forall$$

Produced .tex file includes unicode symbols:

% Created 2016-03-04 Pá 21:01
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{hyperref}
\tolerance=1000
\date{}
\title{Unicode characters export test}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.4.1 (Org mode 8.2.10)}}
\begin{document}

\maketitle
\tableofcontents

Unicode characters:

ℝ ℤ ℕ ⇒ ∈ ∀

Same symbols in latex format:

$$\Bbb{R} \Bbb{Z} \Bbb{N} \Rightarrow \in \forall$$
% Emacs 24.4.1 (Org mode 8.2.10)
\end{document}

Pdf file does not :

2. Things I have tried so far:

Xelatex and unicode-math:
This is included in answer from Rasmus. Here I have to admit: I'm not using development version of org-mode he's mentioning. (failed to install it) I've tried xelatex adn unicode-math anyway. My version of Org mode is 8.2.10.

#+latex_compiler: xelatex
#+latex_header: \usepackage{libertine}
#+latex_header: \usepackage{unicode-math}

Including this in file introduces not so lovely message instead pdf file.

  org-latex-compile: PDF file ./unicode_export_test.pdf wasn't produced:
  [package error]

I have checked for correct unicode-math installation:

~ $ kpsewhich unicode-math.sty
/usr/share/texlive/texmf-dist/tex/latex/unicode-math/unicode-math.sty

Installation of Xelatex is the newest version:

~ $ sudo apt-get install texlive-xetex
Reading package lists... Done
Building dependency tree
Reading state information... Done
texlive-xetex is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.

install development version of org-mode: (failed) Following How do I keep current with bleeding edge development? - tutorial I have been able (I think) download it and compile it. Since I have no idea how to tell to Emacs run this version,  Emacs runs Org-mode version 8.2.10 (release_8.2.10 @ /usr/local/share/emacs/24.4/lisp/org/).
I have tried to add following lines to my config.

(add-to-list 'load-path (expand-file-name "~/elisp/org-mode/lisp"))
(remove 'load-path (expand-file-name "/usr/local/share/emacs/24.4/lisp/org/"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org)

Without pleasing result.

Searching internet:
Solution was not found.

Beating my self for being stupid:
Didn't help.

3. Question: How to export unicode characters from org-mode to pdf?

Do I have to configure some org-mode variable?
Compile with different Latex interpreter?
Any other ideas?
If development version fixes this.... How can I install it?


texts: Make delete key also delete region in evil insert mode

texts: In evil insert state, I can mark a region in the buffer using the mouse. If I now press the Delete key (bound to the delete-char command) it deletes the character at the current cursor position and not the the marked region. This behavior is different from how the delete key works in normal Emacs mode where the region is killed. How can I make evil insert mode work the same way?


texts:
When I toggle inline images I can see the image. But I want to rotate it. There is an option to specify a custom width using:

#+ATTR_ORG: :width 80

Is there a similar option to rotate the image?


texts: How do I return to where I was before i-search, goto line, etc

texts:
Let's say I'm on line Y, char X, and then do an i-search or do a goto line. Then I move around there a bit, but then I want to return to Y, X. How do I do this? Is there an automatic mechanism that remembers my position when doing common "jumps" to other places in the code?

I know Emacs has a function that changes point and mark, but C-Space causes highlighting as it's used for copy/paste so seems to be the wrong thing to use. Also, then I have to manually do something before I jump. I'm hoping for a way to magically return. This would be extremely useful.


texts: "Recentf": Open file from *Open Recent* Buffer, but read-only

texts:
I'm using recentf-mode, part of Emacs. I'd like to open a file from the Open Recent buffer read-only, like if I had opened it via C-x C-r. Maybe if you type C-u in the Open Recent buffer before clicking on the file or typing its number.

Thank you!


texts: On monkey-patching a third-party function

texts:
The following snippet, featuring the "fantasy function" clone-function, illustrates what I'd like to do:

(defvar last-enabled-foo nil)

;; hold on to a "clone"/copy of third-party function enable-foo
(defvar original-enable-foo (clone-function 'enable-foo))

;; replace enable-foo with a wrapper function around it
;; module foo.el
(defun enable-foo (foo)
  (setq last-enabled-foo foo)
  (funcall original-enable-foo foo))

Basically, clone-function ensures that original-enable-foo refers to a function that is completely distinct from the newly defined enable-foo.

How could one implement clone-function?


texts: Toggling off all settings in python and julia to get bare setup

texts:
since recently I am using LSP for python, tex and julia on macos with spacemacs develop.
To some extend this is great, but it is something awefully slow using a gui... and it seems that it is not only LSP.
So in these times it would be great to toggle off all additional python/julia 'add-ons' and just keep the basic keybindings and e.g. just the syntax highlighting for python/julia.
I was thinking about using an enhance fundamental-mode with font-locking for the mentioned modes.
Do you have a hint how to achieve this? Or is there maybe a better way to get a fast emacs in gui... in a terminal the navigation is quite fast even with all fancy settings turned on.
Maybe there is a special mode like tiny-python or something similar...
Thank you in advance!
Fab


texts: How to set `org-agenda-prefix-format` before org agenda starts?

texts:
I want to customize org-agenda-prefix-format before org agenda starts ：

(add-to-list 'org-agenda-prefix-format '(todo . "  %b"))

But if I put the previous line in my .emacs.d, Emacs will show me this error:

Error (use-package): org :config: Symbol's value as variable is void: org-agenda-prefix-format

It seems that the variable is not defined before org agenda has been started once.  How to solve this problem?


texts: Using the :match attribute for custom matching for a Helm source

texts:
I'm trying to create a Helm source which matches the basename of files. I created a source which splits the basename of files in recentf list and puts the path behind it in parens (it uses the (DISPLAY . REAL) candidate format, so the real item is still available for opening the file.

I then added a :match attribute function which should match only the basename of the file when searching, but for some reason it still matches the path part.

Can someone tell me why?

(helm
 :sources
 (list
  (helm-build-sync-source
      "Recent Files Basenames"
    :candidates
    (lambda ()
      (mapcar (lambda (f)
                (cons (format
                       "%s (%s)"
                       (file-name-nondirectory f) f) f))
              recentf-list))

    :match (lambda (candidate)
             (string-match
              helm-pattern
              (substring candidate 0
                         (string-match "(" candidate))))

    :action '(("Find File" . find-file)))))


texts: Why is appropos (C-h a) not finding all terms, e.g. backup doesnt find make-backup-file-name-function

texts:
When running C-h a then entering backup, it lists the following matches, but not all of them (e.g. does not find the make-backup-file-name-function)?

Buffer-menu-backup-unmark     M-x ... RET
   Move up and cancel all requested operations on buffer on line
   above.
diff-backup           M-x ... RET
   Diff this file with its backup file or vice versa.
dired-backup-diff         M-x ... RET
   Diff this file with its backup file or vice versa.
dired-flag-backup-files       M-x ... RET
   Flag all backup files (names ending with `~') for deletion.
ediff-backup              M-x ... RET
   Run Ediff on FILE and its backup file.
magit-wip-initial-backup-mode M-x ... RET
   Before saving a buffer for the first time, commit to a wip ref.
package-menu-backup-unmark    M-x ... RET
   Back up one line and clear any marks on that package.


texts: save a particular buffer without prompting on emacs exit?

texts:
I have a particular buffer that collects statistics from my emacs sessions. I could write the buffer every time I update the statistics, but that's not efficient. I want to auto-write the buffer whenever I quit emacs.

I have normal auto-saving turned off. (And besides, auto-saving is not the same as save-automatically-on-exit.)

I've read up on things like kill-emacs-hook and kill-buffer-hook and even local-write-files-hook, but none of them do the job and fire at the right time. In particular, I get the usual "Buffer XX is modified do you want to save it?" prompt before the kill-emacs-hook is run.

I would rather catch and save the buffer before those exit prompts run, but I could also attach a local hook to the stats file when I first read it into my session.

Is there any recommended way to do this kind of thing (save on an exit event, or get ahead of that prompt, rather than auto-save-on-a-timer)?  Thanks

Here's the kind of thing I'm looking for, but this is for shell process buffers, not for normal buffers.

;; don't prompt me when I try to quit a shell buffer
(add-hook 'comint-exec-hook
      (lambda ()
        (set-process-query-on-exit-flag (get-buffer-process (current-buffer)) nil)))


texts: Make emacs format Java more consistently

texts:
When I open Java files originally created and edited in Emacs, the indentation shows up correctly, as in the image below:

However, when I open the same file in Sublime Text, or any other editor besides Emacs, the indentation is messed up, and I can see that it's because Emacs inconsistently mixes spaces and tabs:

Has anyone else encountered this?


texts:
Editing Joomla articles in the web interface is the most pain the world.

The articles in Joomla are stored in a mysql database.

I'd like to figure out how I can connect a buffer to a "value" in mysql database, which contains the html code, so that I can edit the html in Emacs.

Anyone got any idea?


texts:
This is how to do it:

1- create a new empty file and open it
2- write abc
3- change its face to bold and its foreground color to blue
4- type enter to return to line
5- type M-o d to choose the default face
6- write def and type enter
You should get this:

7- but after saving the file, and reopening it, I get this:

As you can see, the second line becomes bold too. When I open the enriched text file in raw text mode, I find this:

Content-Type: text/enriched
Text-Width: 70

<bold><x-color><param>blue</param>abc

</x-color><x-bg-color><param>white</param><x-color><param>SystemWindowText</param>def

</x-color></x-bg-color></bold>

I tested this on Windows 10, but I get the same problem with Debian too. I also used the command emacs -q to ignore my .emacs file and start an out-of-the-box verion of emacs.

This is my M-x emacs-verion on Windows:
GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30


texts: ORG-REF: Indicate just path where to search for bib files?

texts:
I know that one should indicate the bib files for org-ref. I happen to have a huge amount of bib files (exported from Mendeley for each Mendeley folder).

My question: Is it possible to just indicate the path instead of every bib file?

(setq org-ref-default-bibliography '("~/Dropbox/Bib/"))


texts: How to change comment string used by comment-region?

texts:
Emacs generally comments regions well, but sometimes I wish I could change the string it prepends to lines.  For example, in LaTeX, I would like to have a commented region only use a single % per line instead of two, i.e.,

% First line of commented region
% Second line of commented region
% Third line of commented region

Instead of

%% First line of commented region
%% Second line of commented region
%% Third line of commented region

I assume one could just set some variable for latex-mode in .emacs.el, but I could not find the variable name.  Any ideas?


texts: Why isnt `(require 'use-package)` triggered when I open Emacs?

texts:
So, here is my init.el:

(add-to-list 'load-path "~/.emacs.d/site-lisp/use-package")
(require 'use-package)

(with-eval-after-load 'info
  (info-initialize)
  (add-to-list 'Info-directory-list
               "~/.emacs.d/site-lisp/use-package/"))

(use-package try :ensure t) works only when I go next to (add-to-list ...) and press C-x C-e and then, next to (require-package 'use-package), and pressing C-x C-e. Only if do this use-package is activated. When I close Emacs and re-open it I have to press C-x C-e again, and so on. How I can use-package remain active, so to speak; or how can it get triggered everytime I open Emacs?


texts: How do I prevent sed from endlessly reading stdin when run in eshell?

texts:
If you execute the following in bash:

$ echo hello | sed 's/hello/world/g'
world

sed quits immediately, as desired. If you do the same in eshell, sed will still print 'world' but it will keep running, reading from STDIN. Is there a workaround for this? I assume this happens because eshell isn't using normal pipes or something.


texts: Is there a hook that runs when exiting read-only-mode?

texts:
I'd like to set some things (e.g., cursor shape) when in read-only-mode. That part is easy enough with

  (add-hook 'read-only-mode-hook
             (lambda() (setq-local cursor-type 'box)))

Then I'd like to switch it back when exiting read-only-mode. Something like

  (add-hook 'read-write-mode-hook
             (lambda() (setq-local cursor-type 'bar)))

except that there is no such thing as read-write-mode.


texts: use js2-mode instead of js-mode in org babel source

texts:
I want to use js2-mode instead of js-mode inside org-babel sources. Is there a way to define a mode for JavaScript inside those chunks?

#+begin_src js
console.log(1+1)
#+end_src


texts: Manually installing a multifile package to “elpa/”

texts:
When I'm writing a new package, it's great that I can test its
installation by just issuing M-x package-install-from-buffer. This
will install the package with package.el, so that it goes under
"~/.emacs.d/elpa". However, this doesn't work on multifile packages.

What is the procedure for installing all .el files in the current
  directory as a single multifile package?


texts: Remove the suffix `^M` when run ls in org src

texts:
When run ls to print the file list

#+begin_src ipython :session sql :results output
! ls | head -n 5

#+end_src

#+RESULTS:
: create.txt^M
: Lesson 10. Grouping Data.md^M
: Lesson 11. Working with Subqueries.md^M
: Lesson 12. Joining Tables.md^M
: Lesson 13. Creating Advanced Joins.md^M

There are always ^M characters appended,

My machine info:

$ uname -a
Linux alpha 5.3.0-24-generic #26-Ubuntu SMP Thu Nov 14 01:33:18 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

How can I disable such a line-ending representation?

My machine is " Distributor ID: Ubuntu Description: Ubuntu 19.10 Release: 19.10 Codename: eoan "


texts: visibility cycling - org mode - save and restore folding state of sub trees

texts:
Is it possible to have a SAVED visibility in Org mode ?

Something like:

   ,-> FOLDED -> SAVED -> CHILDREN -> SUBTREE --.
   '--------------------------------------------'

akin to this.

SAVED would remember the exact folding state (recorded by the command org-mode-save-folding-state-of-subtree) of the subtree. The folding of the subtree would be restored to the saved state when switching from FOLDED to SAVED.

How can this be done in Org mode ?


texts: Snippet Works with `yas-expand-from-trigger-key` but not `yas-expand`

texts:
Emacs: 27.1
Doom: 2.0.9
Yasnippet: 0.14.0

I have the following snippet that I have been using for a while to record "mood" notes in my journal:
# -*- mode: snippet -*-
# name: New Mood Note
# key: nmn
# --
`(get-current-time)` ${1:$$(yas-choose-value '("" "" "" "" ""))}
:PROPERTIES:
:MOOD:      ${2:Mood index}
:LOCATION:  ${3:Location}

$0

First, it prompts me to choose an emoji (I know, it's kindof corny but it works well for me). After selecting that I just tab to the mood and location sections in that order.
I've been using this snippet successfully for a while in "vanilla" Emacs, but I recently switched everything over to Doom emacs. Now when I try to load this snippet by pressing nmn and hitting the tab key (thus executing yas-expand) I see the follwoing:
21:41:46 Args out of range: "", 1
:PROPERTIES:
:MOOD:      Mood index
:LOCATION:  Location

I'm not ever prompted for an emoji, it just prints that.
The strange part is that when I expand the snippet using yas-expand-from-trigger-key (or test it using yas-tryout-snippet) it works perfectly. It only breaks when I try to use it in an Org doc with plain-old yas-expand, i.e. typing nmn and hitting tab.
I tried using yas snippets instead of doom snippets like to to see if it makes a difference:
(package! doom-snippets :ignore t)
(package! yasnippet-snippets)

But that didn't make a difference. Also I don't have any additional yas-related configuration.
Has anyone else ever seen anything like this?


texts: Org Agenda is looking for agenda file names inside of my todo file

texts:
When I try to open a org-agenda view, I am prompted with emacs claiming that the first line of my todo list is not a valid file, with options to remove it from the agenda list, or abort. Removing it removes the actual line from my .org file.

This is what's in my config:
 (setq org-agenda-files "~/org/todo.org")