texts:
I've got the org-agenda showing all the deadlines and scheduled items for the current week. For items where the deadline is later in the week, they are shown both on the due date and the current day. How do I disable showing tasks with future deadlines on the current date?

As an example, here is my current org-agenda:

Tuesday     6 March 2018
  work:       Scheduled:  TODO Email class telling them to all finish the assignment
  work:       Scheduled:  TODO Review survey
  work:       Scheduled:  TODO Prepare background info slides
  work:       In   1 d.:  TODO Create exam 2
  work:       In   1 d.:  TODO Encryption slides
  work:       In   1 d.:  TODO Encryption lab
Wednesday   7 March 2018
  work:       Deadline:   TODO Create exam 2
  work:       Deadline:   TODO Encryption slides
  work:       Deadline:   TODO Encryption lab

Notice that the last three items under today are duplicated on their due date of Wednesday.


texts:
Currently, I'm inserting unicode characters (mainly math symbols) using TeX input method.  This is cumbersome, since, for each character, I have to do following:

Switch to TeX input method pressing C-\
type latex expression like \Bbb{R} or \Leftrightarrow

There is relatively small subset of unicode characters (10-20) I am inserting all the time.

Q: Is there way to insert unicode characters with few (2-4) keystrokes?


texts: How to explain this strange comint behavior?

texts:
I have the following issue with comint, it could be a bug.  It holds
true in different derived modes, such as python or gdb.  How to see
the strange behavior:

run-python
Enter some stuff: M-20 a, don't press RET
Eval (- (line-end-position) (line-beginning-position)). It returns 20, which is correct.
Move point before >>>. C-a won't work, do C-p C-a C-n instead.
Eval (- (line-end-position) (line-beginning-position)). It returns 4, which is wrong.

Could someone explain this behavior? And if it's not a bug, what's the
work-around to get 20 instead of 4?


texts: CC-Mode doesn't indent arguments to templated functions starting with a curly bracket

texts:
[Reposted here after a comment from wilx on stackoverflow.com]

Consider the following snippet of C++ code, indented using cc-mode:

auto good1 = f(a,
               {1, 2});   // ((arglist-cont-nonempty 1 15))
auto bad1 = f<1>(a,
  {1, 2});                // ((inexpr-statement) (block-open 36))

auto good2 = f(a,
               b,         // ((arglist-cont-nonempty 68 82))
               {1, 2});   // ((arglist-cont-nonempty 68 82))
auto bad2 = f<1>(a,
                 b        // ((arglist-cont-nonempty 114 130))
  {1, 2});                // ((inexpr-statement) (block-open 114))

auto good3 = f(a,
               b,         // ((arglist-cont-nonempty 151 165))
               {1, 2},    // ((arglist-cont-nonempty 151 165))
               c);

auto bad3 = f<3>(a,
                 b,       // ((arglist-cont-nonempty 209 225))
  {1, 2},                 // ((inexpr-statement) (block-open 209))
                 c);

As you can see, the curly-bracket-arguments {1, 2} are not indented properly when occurring in a templated function call. This is due to them being wrongly labelled as ((inexpr-statement) (block-open X)) rather than ((arglist-cont-nonempty Y Z)) (the exact offsets may be different, I edited the comments after using C-c C-s to get the syntactic labels).

Does anybody know how one can fix this? I tried the newest version of CC-Mode (5.32.5) specifically downloaded from Sourceforge as well as the default versions coming with Debian and Ubuntu, but all of them get this wrong.


texts: Retain system color scheme when running without GUI

texts:
I'm typically running emacs -nw: problem is that Emacs overrides terminal (bash) color scheme and uses it's own default one which is in some cases unreadable.

I would like emacs to use default colors which are defined in my terminal "app". I recently updated to Ubuntu 16.04 and this is when this started happening.

Was looking, couldn't find an answer anywhere.

(setq frame-background-mode 'dark)

seems to fix readability problem, however it's not 100% what I would like


texts: Org babel remove currency form ledger output

texts:
Howto remove the currency from the table or get ledger -j to work so that gnuplot can work with the data?

#+NAME: LedgerCli
#+BEGIN_SRC ledger :results raw :cmdline reg "Assets:Service Days" --exchange sd --format='| %D | %t | \n'
SOME LEDGER STATEMENTS

#+END_SRC
#+Name: ledgercli-table
#+RESULTS: LedgerCli
| 2019/12/01 | 12.0 sd |
| 2019/12/03 | -0.5 sd |
| 2019/12/05 | -0.5 sd |
| 2019/12/10 | -1.0 sd |
| 2019/12/17 | -1.0 sd |
| 2020/03/23 | -4.0 sd |
| 2020/04/01 | -0.1 sd |
| 2020/05/19 | -0.5 sd |
| 2020/05/26 | -0.3 sd |

#+begin_src gnuplot :var data=ledgercli-table :file gnuplot.png :exports results
  set xdata time
  set style data linespoints
  set timefmt "%Y/%m/%d"
  plot data u 1:2
#+end_src

#+RESULTS:
[[file:gnuplot.png]]

this results in

gnuplot> data = "/tmp/babel-sC46Yh/gnuplot-DvVaqU"
gnuplot> set term png

Terminal type is now 'png'
set output "gnuplot.png"
Options are 'nocrop enhanced size 640,480 font "arial,12.0" '
gnuplot> gnuplot> set xdata time
gnuplot> set style data linespoints
gnuplot> set timefmt "%Y/%m/%d"
gnuplot> plot data u 1:2
         warning: Skipping data file with no valid points
                        ^
         x range is invalid

If I manually remove all occurrences of sd from the table a plot gets produces - not what I want but that is a different problem.


texts: Is there any function that can print a symlink's full path in dired mode? Alternatively is there any function that can print an arbitrary buffers' full path?


texts:
I've looked all around for footage of ancient Emacs distributions, but to no avail.
The source code for Emacs 16.56 from July 15, 1985 is available on Github, but under no circumstances could I manage to build it.

The original Stallman Emacs paper describes Elisp, the motivation behind Emacs, and some old extensions - but is not enough for one to reconstruct what it felt like to play around with it.

My question is, how did Emacs look like back in the days?
Before org-mode, MELPA, magit, most of the languages we know today - did people do anything besides hacking Lisp?

Were there packages that people used that are now completely forgotten?
How did the "UI" look like?

And as a last question: is there anything we have today that lives unchanged since the first release of GNU Emacs?

I'd be interested to hear from those who used it then.

(I tagged terminal-emacs because the question needs at least one tag.)


texts:
Is there a way to lookup which hooks will run when a given command is called?

For example, for major modes it is pretty easy to guess that activating python-mode will run python-mode-hook. But sometimes it is not obvious (to me at least) which hooks are run.

I would like to know if there is a way to get a list of hooks that will run upon execution of a given command similar to how M-x describe-variable python-mode-hook will show me a list of functions called when that hook runs. Is this possible?


texts: helm-mu on macOS throws Invalid read syntax: (")

texts:
Hej guys,

I get an error when searching through my mails with helm-mu.

Messages gives

Invalid face reference: helm-grep-finish [96 times]
error in process filter: helm-mu-candidate-parser: End of file during parsing
error in process filter: End of file during parsing
error in process filter: helm-mu-candidate-parser: Invalid read syntax: ")"
error in process filter: Invalid read syntax: ")"
error in process filter: helm-mu-candidate-parser: Invalid read syntax: ")"
error in process filter: Invalid read syntax: ")"
error in process filter: helm-mu-candidate-parser: Invalid read syntax: ")"
error in process filter: Invalid read syntax: ")"
error in process filter: helm-mu-candidate-parser: Invalid read syntax: ")"
error in process filter: Invalid read syntax: ")"
error in process filter: helm-mu-candidate-parser: Invalid read syntax: ")"
error in process filter: Invalid read syntax: ")"
error in process sentinel: Wrong type argument: window-live-p, nil [2 times]

I am using MacOS and emacsformacosx.

Help is highly appreciated.

All the best,
Bernte


texts: How do I change the Python interpreter in Aquamacs 3.5 (based on GNU Emacs 25.3.50.1)?

texts:
I have been unable to get my Aquamacs 3.5 (built on Gnu Emacs 25.3.50.1) to run Python 3.  I have put the following lines in both my Preferences.el (the Mac equivalent of .emacs) and within an explicit .emacs without success.  However, I do get Python 3 when I run straight GNU emacs 27.1 both from the Command Line and using the MacPorts Emacs.app.
(setq python-shell-interpreter
      "/Users/pcolsen/opt/anaconda3/bin/python3")
(setq py-python-command "/Users/pcolsen/opt/anaconda3/bin/python3")
(add-hook 'python-mode-hook
      #'(lambda () (setq py-python-command "/Users/pcolsen/opt/anaconda3/bin/python3")))
(add-hook 'python-mode-hook
      #'(lambda () (setq python-shell-interpreter "/Users/pcolsen/opt/anaconda3/bin/python3")))

I have also set the environment variable PYTHON to
export PYTHON="/Users/pcolsen/opt/anaconda3/bin/python3"
Despite all of this, my Aquamacs persists in running Python 2.7. Is there anything else I can do?
The specific version of Aquamacs is Aquamacs 3.5 GNU Emacs 25.3.50.1 (x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build 16G2016)) dated 2019-08-18 rev.


texts: Emacsclient works in terminal but not in gui mode

texts:
Prerequisites

GNU Emacs 28.0.50 built from sources.

Emacs daemon started via systemd with .config/systemd/user/emacs.service:

[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/

[Service]
Type=forking
ExecStart=/usr/local/bin/emacs --daemon
ExecStop=/usr/local/bin/emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure

[Install]
WantedBy=default.target

when starting Emacs with the command emacsclient -t everything works correctly:

when starting Emacs with the command emacsclient -c the the client freezes like this:

Question:
Does someone know why this happens and how to fix it?
Thanks in advance!


texts: How to unhighlight symbol highlighted with highlight-symbol-at-point

texts:
highlight-symbol-at-point is really useful however I could not find an easy way to un-highlight symbols.

Currently I have to call unhighlight-regexp repeatedly for each highlighted symbol.

Is there a better way to:

unhighlight all highlighted symbols in a buffer
unhighlight a symbol at point?


texts: Reduce width of major mode column in Helm?

texts:
Is there a way to make the major mode column in helm narrower? See image below; the major mode names are taking up a lot of space, while the file paths are cut off.

There's helm-buffer-max-length for buffer names (which, ironically, I'd never want to cut off), but nothing for the major mode that I could find.


texts: How to search only the difference region's while using ediff command?

texts:
While viewing diff b/w 2 files using ediff command, i want to search for a string only in the difference region. What is the right way to this?
EDIT: added clarification


texts: Pasting text doesn't work properly in evil-/web-mode

texts:
In certain situations Emacs doesn't properly paste text. Apparently this only happens if the current buffer isn't saved and both web-mode and evil-mode are loaded. I was able to reproduce this behavior with the following config:

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(require 'evil)
(evil-mode 1)
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))

Reproduction:

Edit the following file:

function test() {
    console.log('hello world');
}

Then press the following series of keys:

yGPwywp (Copy the function in front of the cursor, go to the function name, copy it behind the cursor)

Result:

function test() {
tes
    console.log('hello world');
}
function test() {
    console.log('hello world');
}

Apparently the text has been truncated and is being pasted to the next line.
If I remove web-mode (the last two lines) from my config, then everything works as expected:

function ttestest() {
    console.log('hello world');
}
function test() {
    console.log('hello world');
}

Here is the output of web-mode-debug:

Loading /usr/share/emacs/site-lisp/site-start.d/autoconf-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/cmake-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/git-init.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
test.js has auto save data; consider M-x recover-this-file
 [2 times]
--- WEB-MODE DEBUG BEG ---
versions: emacs(25.0) web-mode("14.0.8")
vars: engine("none") minor("none") content-type("javascript") file("/home/tbo/test.js")
system: window(nil) config("x86_64-redhat-linux-gnu")
colors: fg(nil) bg(nil)
minor modes: (completion-in-region-mode global-eldoc-mode evil-local-mode evil-mode undo-tree-mode global-undo-tree-mode shell-dirtrack-mode)
vars:
web-mode-enable-current-column-highlight=nil
web-mode-enable-current-element-highlight=nil
indent-tabs-mode=t
--- WEB-MODE DEBUG END ---

Here is the output of list-command-history:

(evil-yank 10 14 (quote exclusive) nil nil)
(evil-yank 1 53 (quote line) nil nil)


texts: Compile command as a directory variable?

texts:
I am working on a cmake project and I would like to set a directory variable containing the correct compile command. I added this to the root directory of the project in a .dir-locals.el file:

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((nil .
      ((indent-tabs-mode . t)
       (fill-column . 80)
       (compile-command . "cd build && make"))))

If I enter describe-variable for the variable fill-column, I get the message that This variable's value is directory-local, set by the file .... The variable is set from its default of 70 to 80 instead. However, the compile-command variable is unchanged. Is there a bug in the file?


texts:
I recently realized that every time I lunch emacs, after a minute, a strange buffer appear in buffers list that is linked to an emacs process, infact it also appear in system's process list:

When I try to close emacs C-x C-c in mini buffer appears a message that ask me if I'm sure to kill that buffer that has a running process.

That buffer contains only this line:

Lisp expression: Git variable `github.user' is unset.  Set to:

and I don't know how to interact with this buffer

If I kill the buffer without closing emacs, this message appear in mini buffer:

error in process sentinel: Selecting deleted buffer

Can you tell me a way to prevent the creation of this buffer/process?


texts: Is it possible to convert convert an xls file into an org table? I found this article on the emacs wiki but wasn't able to get it to work.


texts:
I have a long list of inactive projects in my org agenda file.

I want to give each inactive project a date for next review, so I can spend less time on them, on average, in my weekly review.

I don't want the solution to this to cause:

Items from inactive projects to show up in the global "List of all TODO entries" view (but switching to use some custom/special view instead of that might be OK, though I don't know how to do that yet).  Currently I have no TODO items in my inactive projects.
Calendar items for inactive projects to appear in the "Agenda for current week or day" view (again, creating a custom/special view for that instead might be OK).

How can I achieve that?


texts: Automatically set `fill-column' based on flake8 setup

texts: How can I automatically set fill-column based on flake8 configuration for python-mode buffers, specifically the max-line-length value in .flake8? Solutions that employs existing extensions are welcome.


texts: how to forcefully recenter the cursor even it's on the 1st of the lines in emacs?

texts:
)

I wonder if I can forcefully recenter the cursor in emacs.

I often use C-l recenter-top-bottom command but It couldn't work at the first of the lines.
I have a vertical monitor for programming purpose, but It's hard to see the top side codes whenever I see.

Is it possible to recenter even the cursor is on the first of the lines?

Thank you in advance :-)


texts: How can I fix sentences detection in org-mode?

texts:
I wanted to use hl-sentences module and discovered in the process that the sentence detection, and thus move between sentence is buggy inside org-mode.

* Title

some text:

- bullet 1
- bullet 2
- bullet 3

** sub-title

If I do an org-forward-sentence  when my cursor is positioned in the second bullet for instance. I'm jumping to the end of sub-title.

Worse if I do a org-backward-sentence when I'm in the middle of bullet 2, the first time I'm going back to the beginning (the b) of bullet 2 (which is ok) but if I do another org-backward-sentence I'm jumping back to the start of some text:.

This feel very wrong as by intuition I would imagine that org-backward-sentence should be a projection.

I would prefer that org-mode treat each bullet as a single sentence.
And also that starting a new "heading" means the end of any previous sentence.

So perhaps there are good reason for these behaviour if not I would appreciate a pointer on how to fix that problem. Perhaps even propose a PR to org-mode.


texts: How can I make emacs ignore part of the file name when deciding major mode?

texts:
If you have a GPG-encrypted file, say notes.org.gpg, emacs figures out that the major mode has to be set to org-mode. This applies in general to any major mode out there; you do not need to modify the auto-mode-alist for each major mode to support that .gpg extension.

I would like to have my own extra extension, let's say .~bkp~ and have emacs ignore that when determining the major mode. Currently, if I have a file named notes.org.~bkp~, the org-mode is not set automatically.

I scoured through files.el, epa*.el, googled but couldn't figure out how emacs is ignoring the .gpg in the file names.

What function can I probably advice or a variable can I tweak to support my custom appended extensions?


texts: Strange behaivor counting lines in hooks `find-file-hook` or `text-mode-hook`

texts:
For me, the clearest measure for the size of a file is its number of lines.
So, I want this information in my mode line.
I am using Doom emacs and, even I could define my own mode line, for such a minor change I would prefer to follow the recommended way: add the information to global-mode-string (see point 4 in doom-mode-line)

I ended up with the following code, which works very well except for one thing.
When I open a file, the displayed number of total lines is not the actual number of lines.
I tried different ways to set correctly brust-buffer-total-lines when opening a file, but none of them worked. The two versions of the function brust-buffer-total-lines-activate summarise all my ideas so far.
(Of course, comments on any part of the code are very well come.)

My questions:
- Why these function do not work when they are called from the hook text-mode-hookor find-file-hook?
- How could I set correctly the variable brust-buffer-total-lines when opening a file?

;; Variable to buffer-locally store the total number of lines.

(defvar-local brust-buffer-total-lines ""
  "Show the numbers of total lines in modeline")

;; Funtion to update the number of lines after every command modifying the buffer (it will be hooked in `post-command-hook`).

(defun brust-buffer-update-total-lines nil
  (when (buffer-modified-p) ;; lighten up post-command hook
    (setq brust-buffer-total-lines
          (save-excursion (goto-char (point-max)) (format-mode-line "/%l/")))))

;; Version 1 of the function to buffer-locally initiate the whole process.

(defun brust-buffer-total-lines-activate nil
  (let* ((curr-file (buffer-file-name))
         (num-total-lines
          (with-temp-buffer
            (insert-file-contents curr-file)
            (line-number-at-pos (point-max)))))
    (setq brust-buffer-total-lines num-total-lines))
  (add-hook 'post-command-hook #'brust-buffer-update-total-lines nil t))

;; Version 2 of the function to buffer-locally initiate the whole process.

(defun brust-buffer-total-lines-activate nil
  (setq brust-buffer-total-lines
        (save-excursion (goto-char (point-max)) (format-mode-line "/%l/")))
  (add-hook 'post-command-hook #'brust-buffer-update-total-lines nil t))

;; Final steps:

;; (add-hook 'text-mode-hook #'brust-buffer-total-lines-activate)
(add-hook 'find-file-hook #'brust-buffer-total-lines-activate)
(setq global-mode-string '("" brust-buffer-total-lines)))

This strange behaviour can be reproduced in vanilla emacs, just init emacs with emacs -Q load the previous code and open a file. You will see that the total number of lines is wrong and it is corrected after modifying the buffer.


texts: Is it possible to reset the state of the Emacs Lisp interpreter without re-starting Emacs?

texts:
More specifically:

If it is possible, what are the necessary steps?
If it is not, what are the technical reasons?

(Prompted by a recent question: Restart emacs from within emacs.)

Clarification:

The state as I see it consists of all the symbols and their bindings, i.e. the environment described in Intro Eval. Resetting is returning to a previous state; this could be a manually stored state or the initial state of the interpreter (corresponding to "starting from scratch").

I realize that Emacs is not a closed system, so anything having to do with its environment is out of our control, but saving and loading an "Elisp core dump" should be possible in theory.

Making sure that changes in .emacs and such take effect is a possible (although silly) application, but I believe this could be useful for debugging elisp code, too.


texts: How to temporarily disable smart-operator?

texts:
I am using smart-operator for Python programming, and I like to use it. However I have also found it annoying for inputting:

regular expressions like .*
equals (=) in an function.

I would like to disable it by a prefix shortcut, is there any way to do this?


texts: ert and elint: Use (eval-when-compile (ert-deftest ....))?

texts:
I'm trying elint for the first time, because I just learned that it reports things that bytecode compiling doesn't.

Mainly it is showing me a few missing requires, which I'm adding.

Only a tests.el is giving many warnings and errors. Distilled example:

(require 'ert)
(ert-deftest my/test ()
  (should t))

elint-current-buffer reports:

In top level expression:
tests.el:2:Warning: Reference to unbound symbol: my/test
tests.el:2:Error: Call to undefined function: should

I figured it might have something to do with macro evaluation. And indeed this makes elint happy:

(eval-when-compile
  (ert-deftest my/test ()
    (should t)))

However. I've never seen anyone do this. (Not that I've read all Elisp ever written. But I've looked at a fair amount, and even tried a quick GitHub search. I also didn't see any discussion of this in ert or elint docs/comments.)

Practically speaking, should I bother to do this?

(I realize "the value of linting" is probably an opinion-based question, which is no good. That's not my intent. I'm looking for practical advice from experienced Elisp programmers -- what sort of problems will I have from either using or not using eval-when-compile here?)


texts:
I am running Emacs version 25.0.92.1, Spacemacs 0.105.x, Windows 7. In my .spacemacs, in dotspacemacs/user-config I have:

;; Org
;; Org-pomodoro
(setq org-pomodoro-length 25)
(setq org-pomodoro-short-break-length 5)
(setq org-pomodoro-long-break-length 15)
(setq org-pomodoro-play-sounds 1)

In .emacs.d\elpa\org-pomodoro-20151217.553\resources I have bell.wav, bell_multiple.wav and tick.wav. When running a pomodoro it doesn't play any sounds. What do I need to change to get sounds working and what do I need to change to use my own sounds?


texts: How to extract all lines under the current, based on a suffix?

texts:
Currently I'm using (thing-at-point 'line t), however I would like to be able to include the next line(s) as long as they end with a suffix (\ for example).

How to recursively build a string based on the current line, accumulating all others until the suffix is not present?


texts: How to better manage the copy/cut/paste shortcuts between emacs and the macOS clipboard?

texts:
I'm running spacemacs v.0.200.9 on emacs v.25.1.1, on macOS 10.11 and 10.12.
And I'm not happy with how the clipboard works between the OS and emacs.

Here's the behaviour I'd expect:

[X] Cmd + c in the OS then Cmd + v in emacs pastes whatever was copied
[X] Cmd + c in emacs then Cmd + v in OS pastes whatever was copied
[ ] d or x in emacs does not copy to the OS clipboard

At the moment, any use of d or x in emacs (yes, this is evil) modifies the clipboard. I would like this behaviour to disappear. I would be ready to have special keys combos to copy from emacs or paste in emacs to achieve this.


texts: How does (org-agenda-todo arg) work? What does the argument mean?

texts:
By trial and error I have found that in org-agenda (org-agenda-todo 'done) marks the entry at point as "DONE".

Can you explain why?

How can I modify the argument to the org-agenda-todo function (or which other function should I use) to mark the entry some other state, e.g. "WAITING"?


texts:
Consider the following very simple Python project tree:

.
├── main.py
└── second.py

main.py:

import second as s

def foo(arg):
    arg.helloWorld()

foo(s)

second.py:

def helloWorld():
    print("Hello World!")

My Jedi setup in ~/.emacs.d/init.el is the same as this file, but you can also see my exact setup here.

This project runs fine (python main.py outputs Hello World!) but running jedi:goto-definition on the helloWorld in arg.helloWorld() gives Definition not found.. However, if I were to change main.py directly to:

import second as s

s.helloWorld()

Now jedi:goto-definition works and jumps to the def helloWorld() in second.py! So it looks to be a problem with Jedi not recognizing arg as coming from s? I am new to Python and maybe there is an intricacy that I am missing... but the bottom line is that I want Jedi to jump to the definition of helloWorld. How do I achieve this? Thanks for helping!


texts: I was wondering whether there is a command that allows to list the TODOs (in a similar way than C-c+a+t) but for the current buffer... a buffer which might not even be within the list of agenda files.


texts: How does Spacemacs allow tab completion in helm?

texts: I am brand new to using Emacs and I love it. I tried Spacemacs to see the functionality it provided out of the box and I want to replicate some of those features in my own Emacs configuration. From what I can see Spacemacs uses Helm and allows tab completion inside Helm. How does it do that? Does it even use Helm? If not what does it use?


texts:
Is there a way of linking to a specific structure block in org mode?

I have a block of text as follows:

* Heading

Some text

** Subheading

some text

#+BEGIN_PROSE Lorem
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
#+END_PROSE

some text

C-cC-l would only store a link to the top of subheading.

I would like to be able the use [[Lorem]] to jump to the bock of text.

Would that be possible?

－－－－－

Update:

Because the text would be printed, I would like any dedicated target to stay within the template code or comment.

I've tried #+BEGIN_PROSE <<Lorem>> and # <<Lorem>> but neither works.


texts: How can I retrieve an HTTPS URL on Mac OS X without warnings about an untrusted authority?

texts:
The following code should in principle return the contents of https://badssl.com

(with-current-buffer
    (url-retrieve-synchronously "https://badssl.com")
  (buffer-string))

But with my GNU Emacs 25.0.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1112)) of 2015-08-24 on OS X 10.10.5, run with -Q, it instead shows me this message:

Certificate information
Issued by:          COMODO RSA Domain Validation Secure Server CA
Issued to:          Domain Control Validated
Hostname:           *.badssl.com
Public key:         RSA, signature: RSA-SHA256
Protocol:           TLS1.2, key: ECDHE-RSA, cipher: AES-128-GCM, mac: AEAD
Security level:     Medium
Valid:              From 2015-04-09 to 2016-07-07

The TLS connection to badssl.com:443 is insecure for the following
reasons:

the certificate was signed by an unknown and therefore untrusted authority
certificate could not be verified

and asks whether to accept the certificate - No/Session/Always. It then works if I accept the certificate.

I do not experience the same problem with, for example, wget. Wget correctly downloads (without asking the question) https://badssl.com and rejects https://self-signed.badssl.com.

Moreover, there appear to be two separate customization groups - gnutls and tls. I have previously compiled emacs with support for gnutls (gnutls-available-p returns t). Gnutls was installed with homebrew.

If I set gnutls-verify-error to t, I instead get the error

gnutls-negotiate: Certificate validation failed badssl.com, verification code 42

so presumably gnutls was not being used in the first example. On OS X none of the files mentioned in gnutls-trustfiles (in /usr/ssl and /etc/ssl) exist.

So how can I configure emacs to use the default trusted root certificates on OS X?

Edit: If I install libressl from homebrew, and add /opt/brew/etc/libressl/cert.pem to gnutls-trustfiles, the issue disappears when using gnutls-verify-error set to t.

Edit 2: In my testing it didn't seem like the value of tls-certtool-program was actually used, but it may be incorrect for OS X anyway: the default certtool on OS X is not the GnuTLS certtool required by tls.el, and with homebrew's gnutls I think it should be gnutls-certtool instead.


texts: Get web-mode to ignore file extension and racket-mode to honor it

texts:
I use both web-mode and racket-mode often. I am also using Pollen, a Racket language for processing text. Pollen uses compound file extensions like:

pynchon.html.pm
stephenson.css.pp
wallace.html.pmd

The relevant extensions are pm, pmd and pp.

web-mode grabs onto these file extensions due the css and html portions on the extension. I would like it to stop doing that. I would like these files to be opened in racket-mode.

This is what I have tried so far in my default.el file (I am using prelude):

;; web-mode
(require 'web-mode)
(defun my-web-mode-hook ()
  "Hooks for Web mode."
  (add-to-list 'auto-mode-alist '("\\.p[mp]\\'" ignore t))
  (add-to-list 'auto-mode-alist '("\\.pmd\\'" ignore t)))
(add-hook 'web-mode-hook 'my-web-mode-hook)

;; racket-mode
(require 'racket-mode)
(defun racket-mode-hook ()
  (add-to-list 'auto-mode-alist '("\\.p[mp]\\'" . racket-mode))
  (add-to-list 'auto-mode-alist '("\\.pmd\\'" . racket-mode)))

(add-hook 'racket-mode-hook 'racket-mode-hook)

Unfortunately my pollen files with an html extension (ex: pynchon.html.pm) still open in html-mode and my pollen files with a pp extension open in puppet-mode.


texts: How to pretty-format code (auto-insert newlines, indent, etc)?

texts:
I'm using spacemacs but presumably it's emacs knowledge that's required here.

I have a JSON file with a single long line, let's say this JSON from json.org/example:

{"menu": {"id": "file", "value": "File", "popup": {"menuitem": [{"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"}]}}}

I would like emacs to reindent this, which means to me not change the leftmost character of line to the proper indentation level, but break the line in several lines.

If I use spacemacs/indent-region-or-buffer (SPC j =) then the text is not changed at all.

How could I ask from emacs to actually break this long line and reindent to get something like this:

{"menu": {
  "id": "file",
  "value": "File",
  "popup": {
    "menuitem": [
      {"value": "New", "onclick": "CreateNewDoc()"},
      {"value": "Open", "onclick": "OpenDoc()"},
      {"value": "Close", "onclick": "CloseDoc()"}
    ]
  }
}}

I'm not interested in a JSON-specific answer, for instance I believe that intelliJ does that for any language it supports (java, json...). I would think it's achievable for any language emacs has a major mode for, or let's say the most popular ones.

EDIT I discovered M-x json-reformat-region that spacemacs ships with and works, but yes, I would like that for any language and with always the same shortcut, based on the major mode...

EDIT2 Ok so my conclusion is that it's implemented for various languages, JSON & lisp at least, presumably others, and it would be easy for yet more (XML/XHTML, go which has go-fmt and also using clang). However there's no generic function name that would do it for all the languages. There is space here to implement it in spacemacs layers for the various languages... I didn't find a X/HTML implementation though, which surprises me a bit.


texts: "helm-documentation"? (search docstrings like apropos-documentation but with helm)

texts:
I just started using helm-apropos.  It's great!

Is there a helm equivalent for apropos-documentation or alternatively does helm-apropos have sources already available to narrow over docstrings?


texts: How can I add a compilation error regex for node js?

texts:
I can't seem to get emacs to recognize node stacktraces. As you can see, I've added what I think is a valid regular expression to compilation-error-regex-alist and compilation-error-regex-alist-alist, but it still does not match, and brings up the file selection dialog if I try to navigate to the next error.

https://cloud.githubusercontent.com/assets/4205/18681080/0cb6630a-7f2c-11e6-9c5c-aeaf62f651a6.png

It appears that it's thinking of test/state-test.js:127 as the file name:

Is there a way to debug the process by which errors are recognized so I can see why it is not matching?

I've run regex in the re-builder showing the file and so it would appear that the line and column groups match:

Here is the lisp code that attempts to add the node regex:

(add-to-list 'compilation-error-regexp-alist 'node)

(add-to-list 'compilation-error-regexp-alist-alist
         '(node "^[ \f\n ]*at.+(\(.+\):\([[:digit:]]+\):\([[:digit:]]+\))$" 1 2 3))

The compilation buffer:

-*- mode: compilation; default-directory: "~/Code/microstates.js/" -*-
Compilation started at Tue Sep 20 12:09:31

npm t
[?25h[0G
> microstates@0.0.1 test /Users/cowboyd/Code/microstates.js
> mocha test/index.js

[?25l[0G
[?25h[?25h[1A[0G[?25h[0G

  The Basic Opaque State
    wrapping an object value in a State
      with pre-defined properties
[0G        1) has those properties by default

  0 passing (38ms)
  1 failing

  1) The Basic Opaque State wrapping an object value in a State with pre-defined properties has those properties by default:
      AssertionError: expected undefined to be an instance of State
      at Context.<anonymous> (test/state-test.js:127:33)

[?25l[0G
[?25h[?25h[1A[0G[?25h[0Gnpm ERR! Test failed.  See above for more details.

Compilation exited abnormally with code 1 at Tue Sep 20 12:09:33


texts: find-library equivalent for C internal source code files

texts:
Is there a built-in Emacs equivalent of find-library for the C internal source code files?

If there is an additional step needed to create an index of the files (e.g., make tags) when building Emacs, please include that step in the answer.

In a nutshell, I'd like to type M-x find-src-library and type the letters fri and hit the tab key and have it complete to fringe.c and then open that file when I press the enter key.


texts: Email is opened in an external program when I try to send it

texts:
When I compose an email with message (via mu4e or otherwise), and include an attachment for a LibreOffice document, I can't send the message. When I try to send it, instead of having the normal response - messages indicating that the message is getting sent, followed by the window closing - what happens instead is that the attachment is opened in LibreOffice!

I can send messages without attachments without a problem, or with attachments of a different filetype.


texts: helm-find-file (and other things) appearing in my main split

texts:
I currently have helm installed.

Sometimes when I have my window split vertically, when I run helm-find-files, it appears in one of the already open windows, rather than creating a new horizontal window at the bottom. Is there a way of ensuring that it always creates a new window?


texts: How to set #+STARTUP: content globally in .emacs?

texts:
I want to change the default behavior of org-mode to show all headings when opening a org file. Per file this is possible with #+STARTUP: content. Unfortunately I can't manage to set this globally in my .emacs.

I am aware of the corresponding manual entry but I can't get it to work. (setq org-startup-folded "content") has no effect.


texts:
Occasionally I use TRAMP mode to edit remote files.

I want to detect if the file open is remote, and if so, get the hostname of the server it's on.

I can't find any buffer-local variable that holds this information, though. tramp-current-host holds the hostname, but isn't buffer local.


texts: Can you configure the agenda weekly view to display horizontally?

texts: When displaying the weekly agenda, can days be displayed side by side, the way they are displayed in Google Calendar's weekly view?


texts:
I am running emacs 25.1.

I have emacs server starting as a daemon on startup and I can open an emacs terminal session with the following alias:

alias em="emacsclient -t"

How can I start the emacs gui in a similar fashion?


texts: Fields: how to avoid field-end-position to overlap with next field?

texts:
I have a text in the beginning of buffer
901 fifth avenue

The word 901 is defined as field "house" and  fifth (including space) as field "street".  So the text with fields is
123456789         <- buffer position
901 fifth avenue  <- text
hhhssssss         <- fields

where h means "house" and s means "street". I can confirm with C-u C-x = that 1 is property field equal to "house" and the following space is of field "street".  Note that 1 (part of house number) is on position 3 and   (the following space) on position 4. So far so good.  I'd like to get field locations in the form "house 1 3", "street 4 9" and so on.  So I naively assumed that I can just jump to the end of one field using field-end and find the next field right there.
However, when I ask (field-end 3) it replies 4, while (field-beginning 4) is 1 and (field-end 4) is still 4.  So at position 4 lisp thinks we are still at the first field "house" while C-u C-x = at position 4 tells we are at the next field "street".  First when I move to position 5 will lisp give beginning 4 and end 10 correspondingly. Why is the field-end position inside of the following field?  Note that it is inside, not just one-past-the-end as (field-beginning 4) clearly refers to the previous field.  So it seems like I have to move past the beginning of the field before lisp sees it, and then add some logic to move back, avoid jumping over the beginning of buffer, not miss length-1 fields and maybe more.
Are there any easier/more robust ways to do this?  Am I totally misunderstanding something?
The only somewhat related reference in documentation was related to stickiness but that is only relevant when inserting new characters?  escape-from-edge argument seems not to be answer as my problem is with the very definition of end-of-field.
GNU Emacs 26.3


texts:
I have installed AUCTeX, it compiled a test file OK, but I can't view the output.

I get " Cannot get Evince viewer ...". Xviewer, should be the analogue in my distro, I think (I have not way to check through TeXworks as it uses an integrated viewer), as that is what I use to view pdf files.

I tried M-x customize-variable  TeX-view-program-list  following the instruction of a related post.

Then under INS, I put as 'name' Xreader. What should I put in the other fields?

$ cat /etc/*-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=sylvia
DISTRIB_DESCRIPTION="Linux Mint 18.3 Sylvia"


texts: Question regarding Emacs Rocks! Episode 13: multiple-cursors

texts:
I'm watching the great Emacs Rocks! Episode 13: multiple-cursors vide at youbube: https://www.youtube.com/watch?v=jNa3axo40qM

There are several places I'm not clear how the author did it. At 0:32: https://youtu.be/jNa3axo40qM?t=32, how the author quickly deletes strings from the underscore character to the end of the words?

At 0:39:https://youtu.be/jNa3axo40qM?t=39, how does the author quickly select the strings like class="fruit"? I guess it's a shortcuts from the html-mode but I can't find anything useful.


texts: Our servers are behind a proxy that requires two factor authenticatio. I managed to get through the authentication process yet was wondering, is there a way of authenticating only once and not for each different connection?


texts: Different indentation in files with same modes

texts:
My .cxx files have 8-character indentation, while .cpp files have 4-character one. They have exact same modes enabled:

My auto-mode-alist has the following c++ lines:

("\\.ii\\'" . c++-mode)
 ("\\.h\\'" . c-or-c++-mode)
 ("\\.c\\'" . c-mode)
 ("\\.\\(CC?\\|HH?\\)\\'" . c++-mode)
 ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode)
 ("\\.\\(cc\\|hh\\)\\'" . c++-mode)

How can I fix the .cxx files?


texts: Is there a pexpect like automation for serial-term or term-mode

texts: Is there something similar to pexpect that can be used to automate a tty connection running inside emacs, i.e. in term-mode or on top of serial-term ? I'd like to automate some repetitive tasks like firmware flashing from within emacs.


texts:
I'm running Ubuntu 16.04. I installed XEmacs 21.4 (patch 22) I want to use org module BUT fail to install/configure it.

In my case I don't use .emacs but rather I have ~/.xemacs/custom.el where I keep all my settings. org module did not exist originally hence I did this:

git clone git://orgmode.org/org-mode.git

This created org-mode directory. Then I added these 2 lines to custom.el:

(add-to-list 'load-path "/home/susja/org-mode/lisp")
(add-to-list 'load-path "/home/susja/org-mode/contrib/lisp" t)

It did not load org module. Then I ran M-x list-packages and did NOT see org package. Could someone please help me to configure org module in order to handle .org files?


texts: How do I enable auto-complete globally on my init file?

texts:
At some moment in time, auto-complete just stopped working for me. I added this code in my init file:

(global-auto-complete-mode t)

But I get this error when starting Emacs:

Symbol's function definition is void: global-auto-complete-mode

I can enable auto-complete on a per buffer basis, so I know it's installed and working. But I want it to be enabled globally by default.


texts: Can "advice-add ... :filter-args" detect if the advised function was called interactively?

texts:
Using advice-add from nadvice.el, I am trying to add a :filter-args advice to an interactive function. Is it somehow possible for it to detect, whether the advised function has been called interactively?

I was trying to use called-interactively-p, but M-x describe-function called-interactively-p says:

  This function is very brittle, it may fail to return the intended
  result when the code is debugged, advised, or instrumented in some
  form. [...]

  Instead of using this function, it is cleaner and more reliable to
  give your function an extra optional argument whose ‘interactive’ spec
  specifies non-nil unconditionally ("p" is a good way to do this), or
  via (not (or executing-kbd-macro noninteractive)).

Sadly, neither works:

The brittleness of called-interactively-p makes it useless here; Only around advise will detect interactiveness correctly with called-interactively-p, but then the original function doesn't see the interactive call that way anymore.
The suggested workaround is actually wrong. noninteractive determines whether the emacs session is interactive, not whether the command was called interactively.

Minimal working example for called-interactively-p

(defun tmpdemo-command (&rest args)
  (interactive '(was called interactively))
  (message "tmpdemo-command:     %-3S %-3S"
    (called-interactively-p)
    (not (or executing-kbd-macro noninteractive)))
  (message "%S" args))

(advice-add #'tmpdemo-command :around #'tmpdemo-around)
(advice-add #'tmpdemo-command :filter-args #'tmpdemo-filter-args)

(defun tmpdemo-around (oldfun &rest args)
  (message "tmpdemo-around:      %-3S %-3S"
    (called-interactively-p)
    (not (or executing-kbd-macro noninteractive)))
  (apply oldfun args))

(defun tmpdemo-filter-args (args)
  (message "tmpdemo-filter-args: %-3S %-3S"
    (called-interactively-p)
    (not (or executing-kbd-macro noninteractive)))
  args)

When executing it interactively as M-x tmpdemo-command:

tmpdemo-filter-args: nil t
tmpdemo-around:      t   t  <-- Only the around advise sees the
tmpdemo-command:     nil t      expected result.
(was called interactively)

When running it non-interactively as (tmpdemo-command 'noninteractive)

tmpdemo-filter-args: nil t  <-- the suggested workaround gives
tmpdemo-around:      nil t      the wrong result!!
tmpdemo-command:     nil t
(noninteractive)


texts: How to reset a counter if `C-g` is pressed

texts:
I'm completely new to elisp, and I want a function which
cycles through 3 options:

Highlight the word.
Highlight the sentence.
Then highlight the paragraph.

What is the proper way to get the function to (setq setnewpoint t) and (setq cyclemarker 1) if I C-g mid-cycle?

(setq cyclemarker 1)
(setq setnewpoint t)

(defun highlight-cycle ()
  (interactive)
  (if setnewpoint
      (progn
        (forward-word)
        (backward-word)
        (point-to-register 1)
        (setq setnewpoint nil)))
  (cond ((= cyclemarker 1)
           (progn
             (register-to-point 1)
             (setq setnewpoint t)
             (setq cyclemarker 2)
             (keyboard-quit)))
        ((= cyclemarker 2)
           (progn
             (register-to-point 1)
             (mark-word)
             (setq cyclemarker 3)))
        ((= cyclemarker 3)
           (progn
             (register-to-point 1)
             (mark-end-of-sentence 1)
             (forward-sentence 1)
             (backward-sentence 1)
             (setq cyclemarker 4)
             ))
        ((= cyclemarker 4)
           (progn
             (register-to-point 1)
             (mark-paragraph)
             (cond ((/= (line-beginning-position) (point-min))
             (next-line)
             (beginning-of-line)))
             (setq cyclemarker 1)))
        ))


texts: How can I fix shift-select-mode with own syntax-table

texts:
So I have modified syntax table for moving with C-<left>.

 (defvar my-wacky-syntax-table
      (let ((table (make-syntax-table)))
        (modify-syntax-entry ?\( "w" table)
        (modify-syntax-entry ?\) "w" table)
        table))

(defun Pfedj/my-backward-word()
  (interactive)
  (with-syntax-table my-wacky-syntax-table
          (backward-char)))

(global-set-key (kbd "C-<left>") 'Pfedj/my-backward-word)

It works fine for moving, but S-C-<left> for selecting with control does not work now. How can I fixed it?


texts: Correctly indent whole buffer in auctex wihtout filling

texts: When using AUCTeX to edit LaTeX files you can call LaTeX-fill-buffer to fill the whole buffer and additionally indent everything correctly. However if I am using visual-line-mode (together with adaptive-wrap) I don't want the filling but just the correct indentation (i.e. what LaTeX-indent-line does locally) for the buffer.


texts: mac-mwheel-scroll screws centered-positon-mode when using mouse pad on a macbook laptop

texts:
I am able to scroll using navigation buttons and external mouse on a Mac with this code that keeps the cursor at a specific line at all times.
I am using this code since it is much faster than centered-cursor-mode.

The only problem I am facing is when using the macbook mouse which is mapped to "mac-mwheel-scroll". When using it, the buffer stalls and the cursor doesn't move at all. Any help to figure a solution out is appreciated.

(defcustom centered-point-position 0.35
  "Percentage of screen where `centered-point-mode' keeps point."
  :type 'float)

(setq centered-point--preserve-pos nil)

(define-minor-mode centered-point-mode
  "Keep the cursor at `centered-point-position' in the window"
  :lighter " centerpoint"
  (cond (centered-point-mode (add-hook 'post-command-hook 'center-point nil t)
                             (setq centered-point--preserve-pos
                                   scroll-preserve-screen-position)
                             (setq-local scroll-preserve-screen-position 'all))
        (t (remove-hook 'post-command-hook 'center-point t)
           (setq-local scroll-preserve-screen-position
                       centered-point--preserve-pos))))

(defun center-point ()
  "Move point to the line at `centered-point-position'."
  (interactive)
  (when (eq (current-buffer) (window-buffer))
    (let ((recenter-positions (list centered-point-position)))
      (recenter-top-bottom))))

(defun centered-point-mode-on ()
  (centered-point-mode 1))

(define-globalized-minor-mode global-centered-point-mode centered-point-mode
  centered-point-mode-on)


texts:
If I go to scratch, M-x web-mode RET, type in this snippet:

<script type="text/x-dust-template">
    {#obj_to_iterate}
    {prop} <----- this should indent
    {/obj_to_iterate}
</script>

What am I doing wrong here? I see bugs with Dust.js have been solved and I can't be the only one doing simple stuff like this without noticing this indentation behaviour.

Also having problems with the general indentation of HTML, sometimes I get a TAB, sometimes I get two spaces, sometimes one space, who knows what else I can get but it is at least consistent so TAB or spaces are always the same for every line that I indent.

I just want one TAB per identation and properly indented Dust, can somebody help me?


texts:
Is there a way to wrap the current line only?
I know toggle-truncate-lines will work on entire buffer, but I would only want to work on a single line specifically.


texts:
Once in a while emacsclient freezes and unable to open the file. This never happens in linux but happens in macOS. Is there any way to understand the main reason for it?

my setup:
$ ❯ emacs --version
GNU Emacs 26.3
$ emacsclient --version
emacsclient 26.3

=> macOS Catalina Version 10.15.7

process running on the background:
alper            28037   0.0  0.6  4517520  97824   ??  Ss    2:24PM   0:34.75 emacs --bg-daemon=\0124,5\012


texts: How to eval sexp in clojure-mode with cider and write result in current buffer

texts:
For example I have the code:
(println "foo")

With cider-pprint-eval-last-sexp-to-comment I can eval the code and get
(println "foo") ;; nil

in clojure buffer and also it print foo in cider-repl buffer.
I would like to get something like this in the current buffer:
(println "foo") ;; nil foo

How can I do this?


texts: I'd like to remove the Archive field column that appears in my packages menu buffer, but haven't been able to find a setting to allow me to do this.  I've tried all I can find in the m-x packages-menu- group but drawn a blank.  As the fm is immense, I wonder if anybody could point me in the right direction.


texts:
I'm using SampleMode
and the ModeTutorial
to create my own mode.  I have a problem with the syntax table. As I understand, // and # start one-line comments like this:

(defvar my-mode-syntax-table
  (let ((st (make-syntax-table)))
    (modify-syntax-entry ?_ "w" st)
    (modify-syntax-entry ?# "<" st)
    (modify-syntax-entry ?\n ">" st)
    (modify-syntax-entry ?/ ". 124b" st)
    (modify-syntax-entry ?\n "> b" st)
    st)
  "Syntax table for `my-mode'.")

 ;;;###autoload
(define-derived-mode my-mode fundamental-mode "My"
  "A major mode for editing My files."
  :syntax-table my-mode-syntax-table
  (setq-local comment-start "// ")
  (setq-local comment-end "")
  (setq-local comment-start-skip "\\s<+\\s-*")
  (setq-local font-lock-defaults
              '(my-font-lock-keywords nil t)
              )
  (setq-local indent-line-function 'my-indent-line)
  ;; (setq-local imenu-generic-expression
  ;;             my-imenu-generic-expression)
  ;; (setq-local outline-regexp my-outline-regexp)
  ;; ...
  )

I have a test file that contains these lines:

#pragma Index = 0
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------

Even without my-mode-syntax-table, the #pragma is font-locked as
comment.
The lines starting with // appear as normal text.
what-cursor-position gives me this information for the //:

             position: 89 of 47986 (0%), column: 0
            character: / (displayed as /) (codepoint 47, #o57, #x2f)
    preferred charset: iso-8859-1 (Latin-1 (ISO/IEC 8859-1))
code point in charset: 0x2F
               script: latin
               syntax: _    which means: symbol
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 2f" or "C-x 8 RET SOLIDUS"
          buffer code: #x2F
            file code: #x2F (encoded by coding system iso-latin-1-dos)
              display: by this font (glyph code)
    uniscribe:-outline-DejaVu Sans Mono-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1 (#x12)

Character code properties: customize what to show
  name: SOLIDUS
  old-name: SLASH
  general-category: Po (Punctuation, Other)
  decomposition: (47) ('/')

There are text properties here:
  charset              iso-8859-1
  fontified            t

As I understand it, this means that the syntax is not detected
correctly. For reference, if I run what-cursor-position in a .cpp file
on a /, the output contains:

           syntax: . 124b   which means: punctuation,
  is the first character of a comment-start sequence,
  is the second character of a comment-start sequence,
  is the second character of a comment-end sequence (comment style b)

This is right what I would like to have in my-mode, but I don't see
what I do wrong...

(Just fyi: font-locking and other stuff is fine, and the mode appears
on the mode-line, so I'm convinced that my-mode works ok in general...)

Many thanks for your help!


texts:
For many built-in commands that require user input in the minibuffer I can yank from the middle mouse button (mouse-yank-primary with <down-mouse-2>). Some examples where this works are rgrep, grep, query-replace, find-file, execute-extended-command.

However, for helm- related commands, I haven't found any where this works. For example, with helm-M-x, helm-swoop, and functions that are on the helm-completing-read-handlers-alist, if I try to yank from the mouse, I get the message:

<down-mouse-2> is undefined
<mouse-2> is undefined

in the minibuffer. Is there any way to use mouse-yank-primary in helm contexts?

The closest I have gotten is:

(define-key helm-map
  (kbd "<down-mouse-2>") 'mouse-yank-primary)

This works to yank the text into the minibuffer, but now it gives me an annoying <drag-mouse-2> is undefined message which I haven't been able to get rid of, and which doesn't appear with the built-in commands mentioned above. Any suggestions?


texts:
Hello fellow Emacs Lisp enthusiasts!

I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.

Here is a minimal code snippet:

(defun foo ()
  (signal 'test-signal '(1 2 3)))

(condition-case nil
    (foo)
  (test-signal nil))

I use Emacs 26.1, but encounter the same behaviour on other versions as well.

Thank you for any help!


texts: Why does :command argument of make-process not work when string passed as a variable?

texts:
This works fine:

(make-process :name "my-proc2"
          :buffer " *my-proc2*"
          :command '("sh" "-c" "echo \"hi\"\nsleep 10\necho \"there\"")
          :connection-type 'pipe
          :filter (apply-partially 'my-pass-it-on-filter "/tmp/mytmprealtest"))

But if I use a variable like the code below I get Debugger entered--Lisp error: (wrong-type-argument stringp body):

(let ((body "echo \"hi\"\nsleep 10\necho \"there from var\""))
  (make-process :name "my-proc2"
        :buffer " *my-proc2*"
        :command '("sh" "-c" body)
        :connection-type 'pipe
        :filter (apply-partially 'my-pass-it-on-filter "/tmp/mytmprealtest")))

The variable should be a string as well, so why doesn't it work?

The documentation for make-process says:

...
:command COMMAND -- COMMAND is a list starting with the program file
name, followed by strings to give to the program as arguments.
...

The variable was a string as were all other arguments, so I'm not sure what is wrong.


texts: Selecting correct font weight variant (Linux)

texts:
Here's a minimal example that does something on Linux (Ubuntu 16.04) that doesn't seem right to me:

M-: (set-frame-font "Ubuntu")
M-x describe-font <RET>

The first couple of lines that Emacs 25.1 (-Q) reports are:

name (opened by): -DAMA-Ubuntu-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1
  full name: Ubuntu:pixelsize=16:foundry=DAMA:weight=normal:slant=normal:width=normal:scalable=true
  file name: /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-M.ttf

It's the bottom line of this that's wrong (Ubuntu-M.ttf) - Emacs is selecting the "Medium" font weight variant, instead of the "Regular". Like many fonts, the Ubuntu font has weight variants beyond the well-known "Regular" and "Bold". Such additional weights can include "Light", "Book", "Demi-Bold", "Black", "Medium".

I would like to use the Ubuntu Regular font for variable-pitch-mode, but the Medium weight isn't suitable. I've tried various different Emacs ways of specifying a font, including "Ubuntu", "Ubuntu-11:weight=Regular", "-DAMA-Ubuntu-normal-normal-normal-*-15-*-*-*-*-0-iso10646-1".

All of these display text in emacs in the wrong, medium weight. Some apps allow selecting font weight by numbers (e.g. 200=Bold), but not, I believe, Emacs. Still, the system's font selection appears to be correct, and I don't understand why Emacs isn't using this

alex@Lucifer:~$ fc-match "Ubuntu"
Ubuntu-R.ttf: "Ubuntu" "Regular"
alex@Lucifer:~$ fc-list "Ubuntu" file family style weight
[correct output]

Can anyone confirm that this problem exists on Linux (it works fine on my Windows machine)? And, even better, can anyone point me to how to get Emacs to pick the correct weight of font?


texts: How to use my custom layout for generating HTML files from org files instead of using the default layout?

texts:
Something similar to this: emacs-org mode and html publishing: how to change structure of generated HTML

I want to have more control on the layout of HTML files generated from org-mode files. The default layout is good, but not good enough for my needs.

How can I change the default layout for any custom one?


texts: Can we pick our emacs proxy settings from the Broader settings set by our desktop environment?

texts:
In linux, the desktop environment stores the proxy settings. These proxy settings are then picked up by applications running for that instance of the desktop environment for a particular user. Your browsers. terminal etc, pick up these settings.

In case of the GNOME terminal, it sets the HTTP_PROXY and HTTPS_PROXY variable while starting the shell. The values for these variables are set by terminal when it starts up and are valid for the duration of the shell.

Can we do something similarly in emacs other than setting up the proxy using the set_proxy function in our init file? Can we set up a generic function that will pick up these settings from the desktop environment?

Starting emacs from the terminal and it picking up the proxy variables from the terminal environment is not the answer what I am looking for. I am specifically trying to find how emacs accesses Desktop Environment settings.


texts:
It's been a while and this question about ELPA fetch errors is getting a lot of views but has no resolution. I want to do some more research. I suspect that GNU ELPA is getting fetched and that the errors are spurious, but I do not know how to confirm that.

Is there a way I can ask Emacs for the local GNU ELPA version, so that I can check if it is up to date? If the repository is versioned, how can I get the date of the most recent package update?


texts: In exwm (Emacs X Window Manager) how can I assign apps to particular workspaces?

texts: For example, no matter in which workspace I start Firefox, I want it to launch in workspace 2. In i3wm I can do this with assign [class="(?i)firefox"] $workspace2.


texts: A dual-purpose function for keyboard shortcut and mouse

texts:
Is it possible to combine the following two functions so that the combined function will work with the keyboard keys (e.g., [return]) and also work with the mouse buttons?  If so, how please?

Background:  The functions are custom creations for an addition to dired-mode that propertizes the dired heading directory (i.e., the path at the top of the dired buffer) with links to open new dired buffers -- e.g., bredcrumbs -- Dired heading directory with text-properties to jump to parent directories

(defun dired-follow-link-with-mouse (event)
"Follow the link in the dired directory heading, causing a new
dired buffer to be opened."
(interactive "e")
  (mouse-set-point event)
  (let ((path (get-text-property (point) 'breadcrumb)))
    (dired path)))

(defun dired-follow-link-without-mouse ()
"Follow the link in the dired directory heading, causing a new
dired buffer to be opened."
(interactive)
  (let ((path (get-text-property (point) 'breadcrumb)))
    (dired path)))

(defvar dired-mouse-map
  (let ((map (make-sparse-keymap)))
    (define-key map [mouse-2] 'dired-follow-link-with-mouse)
    (define-key map [return] 'dired-follow-link-without-mouse)
    (define-key map [follow-link] 'mouse-face)
      map)
  "Keymap for mouse when in `dired-mode'.")


texts: zsh expansion modifiers are treated as comments

texts:
zsh has a ton of syntax. In particular, the # character serves a bunch of different roles. Here are two that are problematic:

Prefix globbing flags

(#b)(*).c

This finds all files that end in .c and captures their basenames using backreferences (#b).

Postfix alternative glob qualifiers

*.c(#q:u)

This lists the uppercase names of all files that end in .c.

In sh[zsh]-mode, the the #s are incorrectly detected as starting comments:

Normally, this wouldn't be a big deal, but unfortunately, this throws the braces out of balance (as indicated by rainbow-parentheses), which messes with the indentation of the rest of the file, making certain files essentially uneditable.

I took a stab at the sh-mode source, but it's pretty dizzying. How can I teach Emacs about this syntax, and how can I answer this sort of question myself should anything similar arise in the future?

p.s. see the Emacs bug I filed a while back.


texts:
I am new to the Emacs (Doom Emacs to be precise) scene, and recently I came up with a minor mode that could come in handy for me so I decided to implement it.
To achieve the full functionality of my mode I need to process some text, but I thought that a good idea could be to implement my own set of tags/delimeters (sorry if this is not the right terminology for it) for org-mode. I am referring to something like the #+BEGIN_SRC and #+END_SRC that org-mode provides, but with my custom processing. So my question is if there's a way to accomplish this task.
EDIT: Some code to what I would want to get
#+MY_CUSTOM_TAG_START
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam

#+MY_CUSTOM_TAG_END

Somehow I would like to process the text in between those two tags. Get as a String and use a function (that I already have implemented) to process that text.


texts:
In python-mode, I invoke pdb on a python script by M-x pdb script.py. I then type c to run till a breakpoint, and hit the name of a big list. It keeps on printing the content of the list in the buffer for pdb, and how can I cancel the printing?
C-c C-c doesn't work.

Thanks.


texts:
What tools do you use to refactor c++ code? For example, how do you rename a variable or function that is spread across files?

If the problem isn't language specific, there are text-based tools that can aid this process. For example projectile-replace and replacing words would be easy. But this can be a pain if there are functions that are named similarly, for example

void foo();
void fooFighter();
void Fighterfoo();

If I want to rename foo to something like foo1, the projectile-replace would match with instances of the other functions and it's mildly time-consuming.


texts: How do I pass a variable definition as a parameter to a command in the minibuffer?

texts:
I am an emacs novice. I am familiarizing myself with making basic changes to the init.el file.
Currently, when I want to load init.el, I first C-h v user-init-file RET, this opens a *Help* screen which gives me its definition, and therefore the location of the file.
I then highlight and M-w its value, then C-x f to a file requester, then delete the default, then C-y the copied file address then RET.
This looks incredibly convoluted.
What I want to know is, can I cut out all of that and instead simply C-x f to a file requester and then pass the user-init-file definition straight to it, with whatever the emacs notation is for expanding variables (which I don't know)? The help files I have read discuss only examining and setting variables, not using them in the minibuffer.
In short, is there a notation for using variable definitions in a minibuffer command?


texts: How can I make Org mode's capture functionality accept tags starting with '%'?

texts:
I use org mode and its capture functionality for capturing notes and tasks on the go. My capture code looks like this:

(setq org-capture-templates '((
     "n"                                ; key
     "Make a note in p.abc.org "        ; description
     entry                              ; type
     (file+headline "p.abc.org" "logg") ; target
     "* %^{Note} :NOTE:          \n%?"  ; template
     :prepend t                         ; properties
     :empty-lines 1                     ; properties )))

This produces a note headline with the tagg "NOTE" if I call the function with C-c c n

The problem arises if I want to use a taggs starting with a "%" sign. Hence, if I change the template line above to

"* %^{Note} :%NOTE:          \n%?"  ; template

I get the following error message: "Capture abort: (void-variable v-N)"

Can I change the code to make capture accept % signs in the beginning of tags?

Thanks in advance for any help :)


texts:
If you add a Note to a TODO task with C-c C-z it adds an inactive timestamp to the note. This way it does not show up in the agenda view.

- Note taken on [2019-11-05 Di 09:32] \\

I want org-add-note to create active Timestamps

- Note taken on <2019-11-05 Di 09:32> \\

Is there a way to enable this?


texts: How can I enable key-binding in a temporary-buffer?

texts:
I have a large number of org files that are created to store some specific information, that wont change. I am trying to create a function to go find that file and insert it into a temporary buffer so that I can view it, but making it dissappear when I hit "q" like a temp buffer. The functionality That I want is special-mode but the problem is that when I enable special-mode I lose the syntax-highlighting of org-mode, and when I enabled org-mode it overwrites the keybindings that I need for special-mode to quit easily. My current solution would be to bind the key for (quit-window) to "q" manually, but I dont know how to do that only for this temporary window, and not for the shared org-mode buffers that I might have open at the same time.

(let ((bufferName "*Temp Buffer*"))
  (get-buffer-create bufferName)
  (switch-to-buffer-other-window bufferName)
  (insert-file-contents "file-that-i-want-to-insert.org")
  (mygroup/minor-special-mode) ;; Originally was (special-mode)
  (org-mode)
  (outline-show-all))

SOLVED

As per the accepted answer below I created a minor mode and that allowed me to override the "q" binding from org-mode.

NOTE I had to restart my emacs for this to work properly, otherwise it was keeping the org-mode binding for q even with the minor mode enabled.

This was the minor mode I created for anyone needing the same solution:

(define-minor-mode mygroup/minor-special-mode
    "Toggle Special minor  mode."
    ;; The initial value.
    :init-value nil
    ;; The indicator for the mode line.
    :lighter " mSpecial"
    ;; The group this mode is in.
    :group 'mygroup
    ;; The minor mode bindings.
    :keymap (let ((map (make-sparse-keymap)))
    (define-key map (kbd "q") 'quit-window)
    map))


texts:
Windows 10, Emacs 25, Dired.

I tried to copy a lot of files in dired, and Emacs "freeze" while copying.
What is the best package for async copy/move files in Dired?


texts: How do I get the name (string) of a compiled function?

texts:
I have this advice in place that executes the called function over the whole buffer if a region is not selected. But I would also like to print a message that tells the user that the function they just called acted on the whole buffer.

(defun modi/whole-buffer-if-not-region (orig-fn &rest args)
  (save-excursion
    (if (region-active-p) ; do the default thing if a region is selected
        (apply orig-fn args)
      (let (fn-name) ; indent the whole buffer otherwise
        (apply orig-fn (list (point-min) (point-max)))
        (setq fn-name (cl-case (type-of orig-fn)
                        ('subr              (subr-name orig-fn))
                        ;; ('compiled-function (symbol-name orig-fn)) ; doesn't work
                        (t     orig-fn)))
        (message "Executed %s on the whole buffer" fn-name)))))

(advice-add #'indent-region :around #'modi/whole-buffer-if-not-region)
(advice-add #'eval-region   :around #'modi/whole-buffer-if-not-region)

Using the above code,

If I do M-x eval-region without selecting a region, I see the message Executed eval-region on the whole buffer.
I would like to get a similar message when I do M-x indent-region without selecting a region. symbol-name does not work here as I learned that the indent-region function is of the type 'compiled-function

With the above code I get the below when I do M-x indent-region without region selection:

Executed #[770 \211\203A \303!\262\212b\210\304 \262b\210n\204 \305y\210`W\2038 `\306\307w\210`|\210l\2042 \310\311"\210\305y\210\202 \307\211\223\210)\202\324 \203u \212b\210\304 \262b\210\312!`W\203p \313!\204j n\203g l\204j c\210\305y\210\202S \210)\202\324    \203\201    "\210\202\324 \212\314!\262b\210\315 ?\205\225 \316\317`#`W\203\305 n\203\243 l\204\246 \320 \210\305y\210\211\203\225 \211`\211\247\203\273 \211@Y\203\300 \321"\210\266\202\225 \211\203\315 \322!\210\307\211\223\266)\323\211\207 [fill-prefix indent-region-function deactivate-mark prefix-numeric-value point-marker 1    nil indent-to 0 regexp-quote looking-at copy-marker minibufferp make-progress-reporter Indenting region... indent-according-to-mode progress-reporter-do-update progress-reporter-done t] 9 2037903 r
P] on the whole buffer

How do I extract the compiled-function name (indent-region in this case)?

Solution

Thanks to @abo-abo's solution below, I got this working as I wanted using the below:

(defmacro modi/add-whole-buffer-if-not-region-advice (symbol)
  "Advice SYMBOL function (that originally acts on a region) to act on the
whole buffer if a region is not selected."
  `(advice-add ,symbol :around (lambda (orig-fn &rest args)
                                 (save-excursion
                                   ;; Execute the original SYMBOL function if
                                   ;; it is called indirectly. Example: we do
                                   ;; not want to trigger this advice if
                                   ;; `eval-region' is called via `eval-defun'.
                                   (if (or (not (eq ,symbol this-command))
                                           (use-region-p))
                                       (apply orig-fn args)
                                     (apply orig-fn (list (point-min) (point-max)))
                                     (message "Executed %s on the whole buffer"
                                              (propertize
                                               (symbol-name ,symbol)
                                               'face
                                               'font-lock-function-name-face)))))))

(modi/add-whole-buffer-if-not-region-advice #'indent-region)
(modi/add-whole-buffer-if-not-region-advice #'eval-region)


texts: Is there a way to modify or redefine a type of org-link locally?

texts: I am searching for the best strategy to define custom behaviour for file: org-links locally to a buffer. Is there a way to modify or redefine this type of org-link ?


texts: How can I evaluate elisp in an orgmode file when it is opened?

texts:
I have elisp code I'd like to run in orgmode files when they load (different for different files, and defined in the file itself). Is there a way to do this? I didn't see anything in http://orgmode.org/manual/In_002dbuffer-settings.html

If I can add something to emacs initialization that runs a specially named code block whenever an orgmode file loads, that might be a solution, but I'm not sure how to do that, and ideally there is something built in.


texts:
highlight-regexp is pretty amazing, but when I run it manually by M-x highlight-regexp RET f?o RET 'someface it only applies the highlight to the current buffer.  How can I apply a highlight to multiple buffers?

Similarly I would like to automatically highlight tabs in all files with a nasty face as I am allergic to them. Can I put something in my init.el to do that?


texts: Change the background color of specific block?

texts:
I would like to start a different background color beginning from a function to the end.

Like this:

I'm aware you can define background colors from some faces like function and function names like foobar. But it affects only the background color of the words function and foobar. I would like to change the background color of the whole line where the function stats and end with it.

Why, you would ask?
It would make it a lot easier for me to distinct which parts belongs to a funcion.

So I'm wondering if there is a pratical way to manage this in Emacs, of there is a Lisp package to achieve something like that?


texts: Is there a way to use AUCTeX'S HEAD from package.el?

texts:
There's recently been a commit to AUCTeX that I would like to start using right away, but I would like to use the built-in package system to manage the updates.  Is there a way to use package.el to pull in AUCTeX's HEAD rather than tags?

(This might be a misunderstanding of how the package system actually works. If so, forgive me :).)


texts: Print message in echo area with no "quotes"?

texts:
Q: how do I print a message in the echo area without surrounding quotes?

Here's a simple command:

(defun test-fn ()
  (interactive)
  (message "Test message"))

When I call it as an interactive command via M-x test-fn, it prints Test message in the echo areas without surrounding quotation marks.  However, when I evaluate it in elisp as (test-fn), it prints "Test message" in the echo area with surrounding quotation marks.

First of all, why is there a difference between these two use cases?  Second, and more to the point, how can I call the function non-interactively and have the message print to the echo area without the surrounding quotes?


texts: Regular expressions tool example explanation

texts:
Reading the section regular expressions in EmacsWiki appears this:
You can use a tool to construct regexps. For example, you can use ‘rx’ like this:

(rx (or (and "\*" (*? anything) "*/") (and "//" (*? anything) eol)))

To produce this regexp (which matches C-style multiline and single line comments):

\\*\\(?:.\\|\n\\)*?\\*/\\|//\\(?:.\\|\n\\)*?$

I get the or will match either C-style multiline or C/C++ single line comments.
But I do not get the and parts.

I am not sure how anything works and am assuming that will match any char.
It might be something equivalent to .*. Is it?

If I got it right, *? is the non-greedy variant of * operation.
Which really confuses me... The smallest possible match for anything?

Why the C-style multi-line opening is shown as "\*"?
I suspect it is a typo on EmacsWiki and it should be "/*".


texts: Get git repo root directory, preferably with magit

texts: How can I get the root directory of the current git repo? I could run shell-command-to-string on something like git rev-parse --show-toplevel. Is there a better way? Does magit or any other git front-end expose this info?


texts: Helm: not hide helm-mini after kill buffers?

texts:
Windows 10, Emacs 25.1, Helm

If I want to delete buffers from helm-mini I use the next steps:

Open helm using helm-mini
Scroll through the list and mark the ones you want to delete with C-Spc
And all you want are selected, press M-S-d / M-D

This deletes all selected buffers and closes helm.

Here result:

and here result message:

OK. It's work.

But I wan't to close helm-mini after kill buffers.

Is it possible?

`


texts:
Suppose I want to use the following definitions for effort estimates across all org files - or simply set globally, That is, I want to achieve the effect of having this line at the top of all my org files (or at least the agenda files):

#+PROPERTY: Effort_ALL 0 0:10 0:20 0:30 1:00 2:00

How would this be written in the .emacs file?


texts: Outline editing, like org-mode, for JSON

texts:
I am trying to edit a Swagger JSON file in emacs. It contains large nested JSON objects, so I want to collapse and hide some of them.

I have tried origami-mode, configured as origami-c-style-parser in origami-parser-alist, but it is quite unsophisticated (the word "parser" seems to be an overly grandiose word for what it does). It doesn't notice that Swagger URL parameter substrings like {id} are inside JSON strings, so it happily collapses them too when I ask it to collapse all nodes in the buffer except the current node. I don't want it to do that. I want a way of collapsing only JSON subtrees like objects, not substrings of JSON strings that happen to have curly braces in them. How can I achieve this goal?


texts: Emacs (ipython) inferior python shows strange input numbers

texts:
In emacs, I use ipython in the inferior python mode with config:

(setq python-shell-interpreter "ipython"
    python-shell-interpreter-args "--simple-prompt -i")

When I edit my .py file, without any input to inferior python, the input number jumps occasionally.

I suspect that I send some unintentional inputs to the inferior python. But, I don't know how. It happens quite randomly.


texts: Manually close a (compilation) window that was most recently opened by running e.g. 'grep'

texts:
I'm trying to find a way to quickly close the window that I just created by running 'grep' (i.e. a kind of compilation window).

I'd like the solution to be independent of my current window layout and also of which window that's currently in focus. This so I can always use the same keyboard shortcut.

I thought I could find an Emacs command to switch to the most recently created window, i.e. the one just created by 'grep'. Then I could just use that command followed by 'q' to close the 'grep' window. However, I haven't been able to find such a command.

Unfortunately the 'other-window' command (C-x o) doesn't work as well as I'd like in the following configuration. Here the Emacs frame is split into two windows (C-x 3) with the cursor in the right window (W2). I.e. it initially looks like this:

.-------.-------.
| W1    | W2 _  |
|       |       |
|       |       |
|       |       |
'-------'-------'

Then, after the grep command, it looks like this, with focus still on 'w2':

.-------.-------.
| W1    | W2 _  |
|       |       |
|-------|       |
| *grep*|       |
'-------'-------'

The annoyance is now that 'C-x o' switches to 'W1' rather than 'grep'.

Now, when I'm in 'W2' I can use e.g. 'C-- C-x o' to switch to 'grep'.
But unfortunately, but if the cursor is instead in 'W1', then 'C-- C-x o' leaves me in 'W2' rather than 'grep'.  So I'll then have to remember which command to use depending on my location.

Note: I could create a shortcut that closes the 'grep' window/buffer, but it'd be nice if the solution here works also for other compilation-like windows.

Update/clarification:

If the Emacs frame isn't as tall, e.g. on a laptop, this window setup:

.-------.-------.
| W1    | W2 _  |
|       |       |
'-------'-------'

results in 'W1' being replaced by 'grep' instead of a 'grep' window being added. I.e. it results in this:

.-------.-------.
| grep  | W2 _  |
|       |       |
'-------'-------'

In this case, as some of the answers suggest deleting the 'grep' window, the resulting window setup ends up being this:

.---------------.
| W2 _          |
|               |
'---------------'

So it turns out I don't necessarily/always want to delete the window containing the 'grep' buffer.


texts: When reloading an org mode file, why do I get a whole bunch of `^M` chars in my file?

texts: I'm just learning emacs and I'm using spacemacs configuration. I created a .org file and everything looks normal when I save it, but when I reload it I get a whole bunch of ^M chars at the end of each line. How do I avoid this?


texts:
I've only just recently started using avy to navigate inside my buffers and it seems to work nicely.

As for my question however, with avy-all-windows set to all-frames I am able to navigate between several GUI emacsclients. I am also able to move from terminal emacsclients to GUI clients.

However, I am not able to move from one terminal to another, or from GUI clients to terminal clients. The appropriate destination hints do appear in the Emacs frames however, and typing the hint-keys will activates the correct point position in the intended destination (terminal) frame but focus will remain in the frame that issued the command.

Is there any way to work around this and change focus to the destination
terminal frame?


texts: How can I get autocomplete lists to show correctly in a buffer with a variable-pitch font?

texts: In a variable-pitch buffer, autocomplete dropdown lists show up with each row at a different column on the screen, I'm guessing because the dropdown lists are set to show at the same x-value based on the number of characters, not the number of pixels. Is there any way to fix this?


texts: Input and Output does not show up in python mode

texts:
I am using the Python mode with Emacs 25.1.1 to send parts of my python scripts to an ipython console. I have the problem that both the input and the output is not shown in the python window. Whenever I use C-c C-c the line is sent to the console and is executed but in the window only an additional line number shows up. Neither the input nor the output is visible.

When I use C-c C-p to start the python console I get the error message

Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native’ was t and "ipython" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally.


texts:
When I insert a link into an org-file using C-c C-l (Doom Emacs, if that matters) and select file:, it show me the files in the current directory to autocomplete from. However, when editing such a link with C-c C-l, there's no auto-completion anymore. Can I change this somehow?
This mailing thread seems to talk of the same issue, but using C-u C-c C-l as suggested there doesn't work - C-u immediately jumps up (I guess due to evil).


texts: How to make an invisible overlay displaying other text clickable

texts:
I've been trying to add the ability to unfold with mouse by clicking on ellipsis in my json-mode, but after considerable time spent experimenting and looking through the Elisp manual, I can't figure out how to bind a function to clicking on the overlay I add when I fold.

Currently, my folding function looks like this:

(defun json-mode-hide-region (beg end)
  "Hides region from BEG to END with an overlay."
  (let ((overlay (make-overlay beg end))
        (map (make-sparse-keymap)))
    (define-key map [follow-link] (kbd "mouse-2"))
    (define-key map (kbd "mouse-2")
      (lambda (&rest args)
        (interactive)
        (delete-overlay overlay)))
    ;; FIXME: show hidden content in isearch before it's finished
    (overlay-put overlay 'invisible t)
    (overlay-put overlay 'isearch-open-invisible #'delete-overlay)
    (overlay-put overlay 'display json-mode-fold-ellipsis)
    (overlay-put overlay 'mouse-face 'highlight)
    (overlay-put overlay 'help-echo "mouse-2: unfold")
    (overlay-put overlay 'keymap map)
    (overlay-put overlay 'evaporate t)))

It's worth noting that I use lexical-binding to have proper lexical scoping and closures in my code, the entirety of which is in this repo. I've tried moving out the function that handles mouse-2 to a separate function, and even throwing errors in it, but it seems to never get called. It seems that documentation about making clickable buttons and links is mostly related to text properties, and overlays which don't make the original text invisible.

Does anyone know how to turn the display text into a link that calls a function when clicked (which deletes the overlay in my case)?


texts: How to make C-g cancel evil-replace rather than typing ^G?

texts:
In evil mode, the r command, evil-replace, waits for a replacement character to be typed and replaces the current character with it. Sometimes I hit r by mistake and wish to cancel, so I hit C-g. Instead of cancelling the evil-replace, however, it replaces the current character with the escape code ^G which I then have to undo.

Is there a way to make C-g cancel the evil-replace, like esc does?

Update: this is now built in to evil. See https://github.com/emacs-evil/evil/pull/1111. The answers below now only apply to legacy evil versions.


texts: Link to individual Org-mode tag from headline

texts:
I frequently want to follow an individual tag on a headline to see all the other headlines with that tag, however currently the entire tag block is bound as an agenda link, not each tag.

I've read up a bit on making custom links in Org but it seems like changing the behavior of the tag links will require advising or replacing whatever function handles the linking.

Does anyone have a starting point in the Org source for this?


texts: List variable that is set to one list or another depending on condition

texts:
I am trying to create a list variable that can be set to one list or another depending on a condition. What I have so far is as follows.

(let ((l (if local list1 list2)))
  ; Append items to the list
  )

local is a parameter that can be set to t or nil.
list1 and list2 are list variables.

Then when I later try to access either list1 or list2, I am getting the following error.

Lisp error: (wrong-type-argument sequencep t)

Essentially, what I am trying to do is update either list1 or list2 depending on the value of local. Perhaps this is what is causing my issue.

The following is the shortest code segment that illustrates the problem.

(defvar local-list '())
(defvar global-list '())

(defun add-item-to-list (local item)
  (let ((l (if local local-list global-list)))
    (add-to-list 'l item)
    )
  )

(defun print-local-list ()
  (mapc (lambda (item) (message item)) local-list)
  )

(add-item-to-list t "Blue")
(add-item-to-list t "Greem")
(add-item-to-list t "Red")
(print-local-list)


texts: Variable-pitch face breaking indentation in org mode

texts:
I want to use a variable pitch face when using org mode (for composing articles, prose, etc.) The emacs wiki suggested using buffer face mode with a hook to set the face for org mode buffers:

 ;; Use variable width font faces in certain buffers
 (defun my-buffer-face-mode-variable ()
   "Set font to a variable width (proportional) fonts in current buffer"
   (interactive)
   (setq buffer-face-mode-face '(:family "Liberation Serif" ))
   (buffer-face-mode))

 ;; Set default font faces for org  modes
 (add-hook 'org-mode-hook 'my-buffer-face-mode-variable)

This correctly changes the buffer face to variable-width, but seems to break org mode indentation.

Without buffer face mode, the buffer uses the default fixed pitch face for text and a variable pitch face for headers (as defined by the theme.) The resulting indentation is correct:

With buffer face mode both text and header use variable pitch face, but breaks indentation of all but the first line of headers:

Perhaps there is a conflict using variable pitch faces with indentation or with visual line mode, which I also use?

 (with-eval-after-load 'org
  (setq org-startup-indented t)
  (add-hook 'org-mode-hook #'visual-line-mode))


texts: How to set web-mode to use single-line comment style instead of multi-line for JavaScript

texts:
When commenting C-style code like C++, JavaScript etc., I use single-line comments to be able to uncomment a previously commented region selectively, i.e

// This
// is
// a single-line style
// comment

If I later want to uncomment lines 2 and 3, for example, I would simply select them and uncomment. With multi-line comments /* */, however, I would first need to uncomment the whole block, then selectively comment the parts excluding those that I wanted to uncomment in the first place. From this question, I found out that I can change the comment character to // by putting in my config

(setq-default web-mode-comment-formats (remove '("javascript" . "/*") web-mode-comment-formats))
(add-to-list 'web-mode-comment-formats '("javascript" . "//"))

This, however, does not change the commenting behavior of web-mode. When I select the desired region and run web-mode-comment-or-uncomment-region, it still exhibits multi-line behavior and uncomments the whole block instead of the region that I select.

How can I uncomment just the selected region instead of the whole block?


texts: Shrink frames in beamer export from orgmode

texts:
How can I send a shrink option to a beamer frame?

I already tried with

*** frame title
:PROPERTIES:
:BEAMER_envargs: [shrink=5]
:END:

as suggested in https://lists.gnu.org/archive/html/emacs-orgmode/2011-01/msg00078.html, but it didn't work.


texts: Indentation using multiple org src block

texts:
So, say I have a literate org file as follows:

#+TITLE: Random Scrap

* Do something
:PROPERTIES:
:tangle: scrap.pl
:comments: org
:END:

#+BEGIN_SRC perl
  sub my_func{
    my $var = pop;
#+END_SRC

some thoughts here..
and the func continues...
#+BEGIN_SRC perl
    my $var1 = $var+1;
 }
#+END_SRC

Tangling it to source using C-c C-v C-t gives me the following ugly code:

# Do something
# :PROPERTIES:
# :tangle: scrap.pl
# :comments: org
# :END:

sub my_func{
  my $var = pop;

# some thoughts here..
# and the func continues...

my $var1 = $var+1;
}

My questions are:

Is there a simple way to preserve indentation across source blocks, when all of them are going to tangle to a single file?
Is there a way to avoid the # :PROPERTIES: ... # :END: text to come to the header?

It would be great to have the first feature available. Org mode is a great tool for documenting source code. However, the wrong indentations put it off sometimes. At times, I break the code into fragments that indent properly. At other times, it is required to break code elsewhere, and causes issues like this.

Thanks in advance!

EDIT

(setq org-src-preserve-indentation t) solved my problem partially. The output tangled file now goes like:

# Do something
# :PROPERTIES:
# :tangle: scrap.pl
# :comments: org
# :END:

  sub my_func{
    my $var = pop;

# some thoughts here..
# and the func continues...

    my $var1 = $var+1;
  }

However, the comments are still out of indentation. Also, the responsibility of maintaining indentation now lies with me. And the header text is as is...

Any comments/answers? I feel this solution is a bit hacky...


texts: Create GitHub issue for current repository

texts:
I'd like to be able to create GitHub issues from Emacs using a simple command, e.g.

M-x create-github-issue RET <title> RET <comment> RET

Ideally, the command would default to the current repo when called from a buffer visiting a file that belongs to a git repository.

I checked the repos (ELPA, MELPA, Marmalade); the closest thing I could find is gh, which is a

  GitHub API library for Emacs.

It includes gh-issues.el which looks like it could be used as a starting point for implementing such a feature. But since I don't want to reinvent the wheel:

Does anybody have a hand-rolled solution for this that they could share (or know of a package that I missed that implements this functionality)?


texts: How to automatically restore the previous window layout after gdb?

texts:
I am unable to find any gdb-kill-hook or similar.

After calling gdb with gdb-many-windows the frame gets a new window layout.

I am trying to store the previous layout in a register and to restore it after quitting gdb.

Is there any way to achieve this?


texts: Set a variable to a Windows path in init file

texts:
I want to use python in spacemacs on window OS, and need to tell it where to find python shell. So I added one line of

(setq-default python-shell-interpreter "C:\Anaconda\Scripts\ipython.exe")

to the .spacemacs

But when restart the spacemacs, it won't start up as spacemacs, instead it's like normal emacs without spacemacs installed. But if I remove that line, I could get the spacemacs screen, so how should I set the variable in spacemacs init file?

(defun dotspacemacs/init ()
  "Initialization function.
This function is called at the very startup of Spacemacs initialization
before layers configuration."
  ;; This setq-default sexp is an exhaustive list of all the supported
  ;; spacemacs settings.
  dotspacemacs-default-package-repository nil)
 ;; User initialization goes here
(setq-default python-shell-interpreter "C:\Anaconda\Scripts\ipython.exe")
)


texts:
M-return is interfering with export (M-return e e) and other functions that I use a lot.

I tried (define-key org-mode-map kbd "M-return" nil),
but after loading that (with M-m f e r, since I am using Spacemacs), I still get the binding.


texts: Package for inline editing in another major mode

texts:
I work a lot with Typescript files for Angular 2. The whole HTML structure is packaged in a quote. I would like to select that quote, and edit it in another mode (HTML/Web mode), then save it back to the buffer with the Typescript mode.

I knew there is another package for that, but I cannot find it back. Even not on emacs.zeef.com and Google.

Does anyone recognize which package I mean?


texts: How to make compile function obey my .bashrc when compile is called by some library?

texts:
In my ~/.bashrc I've got some changes, the most important one being the change to $PATH. One of the commands I'm using runs through the compile function, but it fails - bash can't find the binary.

Because I can run the binary just find from the command line, and the path to the binary is added to $PATH in my .bashrc, I think that compile doesn't read my .bashrc and thus can't find the binary it needs to run.

The compile function is called by some library to call some other program from shell, so I'd rather not modify the original code.

How can I make compile run the .bashrc first to fix this problem?


texts:
How to clock-out current org-task before exit from Emacs? I tried

(add-hook 'kill-emacs-hook #'org-clock-out)

But if there is no current active tasks, Emacs says "No active clock" instead of exit. If there is an active task, in reality clock-out does not occur and the next time when I'm trying to make org-clock-in, see the proposal to resolve the conflict.


texts: In MacOS, is there any way to have native Mac layout for ‘option-something’ special symbols in quoted-insert?

texts:
With quoted-insert (C-q) I can enter ‘Option-something’ extended characters, but Emacs apparently understands them as ISO 8859-1. Meanwhile, MacOS has its own layout for these characters (changed with the input language or custom layouts), and there's a cheatsheet in the form of ‘Keyboard viewer.’

Is there any way to make Emacs use the same layout for M-something in quoted-insert as native applications do?

I could conceivably edit a keymap by hand to reflect the system one, but 1) I don't see a mention of a special keymap for quoted-insert, and 2) I'd prefer not to.

Apparently Emacs does receive native characters if Option keys aren't set up as Meta, however I don't have an abundance of modifier keys on my keyboard so I'd prefer to keep Option as Meta and use quoted-insert when needed.


texts:
I have a workflow that goes like, 1) use a snippet then 2) call a function.

What a glorious opportunity to automate!  But how?

The snippet ipdb inserts import ipdb; ipdb.set_trace().  It has definition:

# -*- mode: snippet -*-
# name: ipdb
# key: ipdb
# --
import ipdb; ipdb.set_trace()

The function bm-toggle, from the lovely bm package, sets a visual bookmark on the current line.

The result of using each in sequence is a highlighted line indicating where my debug statement is:

I immediately think of hooks and see that there are indeed a variety of yas hooks.  However, these hooks appear to be general; I only want to call a hook on a specific snippet.